getState - Get code and calibration configuration from code mappings for block
state - MATLAB ([original](https://in.mathworks.com/help/ecoder/ref/getstate.html)) ([raw](?raw))
Get code and calibration configuration from code mappings for block state
Since R2020b
Syntax
Description
[propertyValue](#mw%5Fd9d8ae62-4944-45d3-8c90-6a2f79c5f97c) = getState([myCodeMappingObj](#mw%5Ff0789f5d-b539-4497-9b77-4944d53bfcca),[block](#mw%5F2ca28af2-4a82-479b-adeb-c497cb680afb),[property](#mw%5F70e8ccc3-d502-41a3-8784-033c7373caf5))
returns the value of a code mapping property or calibration property for the state of the specified block. For example, use this function to return the storage class or calibration access of a measurement property configured for a block state.
Examples
From the model code mappings for modelConfigurationRapidPrototypingInterface
, get the name of the storage class that is configured for state X
of Unit Delay blockDelay
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); state = find(cm,"State"); scX = getState(cm,state,"StorageClass");
From the model code mappings for modelConfigurationRapidPrototypingInterface
, get the calibration properties configured for state X
of Unit Delay blockDelay
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); state = find(cm,"State"); prop_export = getState(cm,state,"Export"); prop_bitmask = getState(cm,state,"BitMask"); prop_calaccess = getState(cm,state,"CalibrationAccess"); prop_compname = getState(cm,state,"CompuMethod"); prop_dispid = getState(cm,state,"DisplayIdentifier"); prop_format = getState(cm,state,"Format");
Input Arguments
Code mapping object (model code mappings) returned by a call to functioncoder.mapping.api.get
.
Example: myCM
Path of the block for which to return the state code mapping information, specified as a character vector or string scalar. Alternatively, you can specify a block handle.
Example: blockHandle
Data Types: char
| string
| block_handle
Code mapping property for which to return a value. For a storage class defined in the Embedded Coder Dictionary associated with the model, specify a property name or one of these property names.
Information to Return | Property Name |
---|---|
Name of storage class | StorageClass |
Name of variable for state in the generated code (unavailable when storage class is specified as Auto) | Identifier |
Name of source definition file that contains definitions for global data that is read by the state and external code | DefinitionFile |
Name of get function called by code generated for the state | GetFunction |
Name of source header file that contains declarations for global data that is read by the state and external code | HeaderFile |
Name of memory section that contains data read by the state | MemorySection |
Name of model for which the code generator places the definition for a state shared by multiple models in a model hierarchy | Owner |
Boolean value indicating whether code generator preserves dimensions of a state that is represented as a multidimensional array | PerserveDimensions |
Name of set function called by code generated for a state | SetFunction |
Name of structure in generated code for a state | StructName |
Boolean value indicating whether to export the selected state to a calibration file (a2l) | Export |
Mask value in hexadecimal format to extract single bits from the state in a calibration tool | BitMask |
Enumeration value indicating the access of calibration.Calibration for a state indicates that the state can be calibrated. NoCalibration indicates that the state can be read-only but cannot be calibrated. NoCalibration is the default value for the property | CalibrationAccess |
Name of the conversion method used during the calibration | CompuMethod |
Optional display name of the state for calibration | DisplayIdentifier |
Specifies the display format of the state being measured in a calibration tool | Format |
Name of the measurement service | MeasurementService |
Example: "StorageClass"
Example: "CalibrationAccess"
Output Arguments
Name of the storage class or value of the specified storage class property configured for the specified block state, returned as a character vector.
Data Types: char
Version History
Introduced in R2020b