getSignal
Get code and calibration configuration from code mappings for block output signal
Since R2020b
Description
returns the value of a code mapping property or calibration property for the signal
specified by a block output port handle. For example, use this function to return the name
of the storage class or calibration access of a measurement property configured for a
signal.propertyValue
= getSignal(myCodeMappingObj
,portHandle
,property
)
This function does not apply to signals that originate from root-level
Inport blocks. For signals that originate from root-level
Inport blocks, see getInport
.
Examples
Get Storage Class Configured for Block Output Signal
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the name of the storage
class that is configured for the output signal of lookup table block
Table1
. After creating the object cm
by calling
function coder.mapping.api.get
, get the handle to the output signals
for the lookup table block. Get the storage class configured for the output port by
calling getSignal
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); lut1_ports = get_param("ConfigurationRapidPrototypingInterface/Table1","PortHandles"); lut1_outPort = lut1_ports.Outport; addSignal(cm, lut1_outPort); scTable1D = getSignal(cm,lut1_outPort,"StorageClass");
Get Code Identifiers Configured for Block Output Signals
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the code identifiers that
are configured for output signals of lookup table blocks Table1
and
Table2
. After creating the object cm
by calling
function coder.mapping.api.get
, get the handles to the output ports
for the lookup table blocks. Get the code identifiers configured for the output ports by
calling getSignal
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); lut1_ports = get_param("ConfigurationRapidPrototypingInterface/Table1","PortHandles"); lut2_ports = get_param("ConfigurationRapidPrototypingInterface/Table2","PortHandles"); lut1_outPort = lut1_ports.Outport; lut2_outPort = lut2_ports.Outport; addSignal(cm, lut1_outPort); addSignal(cm, lut2_outPort); setSignal(cm,lut1_outPort,"StorageClass","ExportedGlobal") setSignal(cm,lut2_outPort,"StorageClass","ExportedGlobal") idTable1 = getSignal(cm,lut1_outPort,"Identifier"); idTable2 = getSignal(cm,lut2_outPort,"Identifier");
Get Calibration Properties Configured for Signal
From the model code mappings for model
ConfigurationRapidPrototypingInterface
, get the calibration
properties configured for signal Signal_1
.
openExample("ConfigurationRapidPrototypingInterface"); cm = coder.mapping.api.get("ConfigurationRapidPrototypingInterface"); port_handles = get_param("ConfigurationRapidPrototypingInterface/Table1","PortHandles"); Signal_1 = port_handles.Outport; addSignal(cm, Signal_1); prop_export = getSignal(cm,Signal_1,"Export"); prop_bitmask = getSignal(cm,Signal_1,"BitMask"); prop_calaccess = getSignal(cm,Signal_1,"CalibrationAccess"); prop_compname = getSignal(cm,Signal_1,"CompuMethod"); prop_dispid = getSignal(cm,Signal_1,"DisplayIdentifier"); prop_format = getSignal(cm,Signal_1,"Format");
Input Arguments
myCodeMappingObj
— Code mapping object
CodeMapping
object
Code mapping object (model code mappings) returned by a call to function
coder.mapping.api.get
.
Example: myCM
portHandle
— Output port handle of signal source block
port handle
Block output signals for which to return signal code mapping information.
Example: portHandle
Data Types: port_handle
property
— Code mapping property value to return
StorageClass
| Identifier
| DefinitionFile
| GetFunction
| HeaderFile
| Owner
| PreserveDimensions
| SetFunction
| StructName
| storage class property name
| Export
| BitMask
| CalibrationAccess
| CompuMethod
| DisplayIdentifier
| Format
| MeasurementService
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 signal data in the generated code | Identifier |
Name of source definition file that contains definitions for global data that is read by the signal data and external code | DefinitionFile |
Name of get function called by code generated for the
signal data | GetFunction |
Name of source header file that contains declarations for global data that is read by the signal data and external code | HeaderFile |
Name of model for which the code generator places the definition for a signal data shared by multiple models in a model hierarchy | Owner |
Boolean value indicating whether the code generator preserves dimensions of a signal data that is represented as a multidimensional array | PerserveDimensions |
Name of set function called by code generated for a
signal data | SetFunction |
Name of structure in generated code for a signal data | StructName |
Boolean value indicating whether to export the selected signal to a calibration file (a2l) | Export |
Mask value in hexadecimal format to extract single bits from the signal in a calibration tool | BitMask |
Enumeration value indicating the access of calibration.
Calibration for a signal indicates that the signal can be
calibrated. NoCalibration indicates that the signal 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 signal for calibration | DisplayIdentifier |
Specifies the display format of the signal being measured in a calibration tool | Format |
Name of measurement service defined in Embedded Coder Dictionary | MeasurementService |
Example: "StorageClass"
Example: "CalibrationAccess"
Output Arguments
propertyValue
— Name of storage class or value of storage class property
character vector
Name of the storage class or value of the specified storage class property configured for the specified signal.
Data Types: char
Version History
Introduced in R2020b
See Also
addSignal
| coder.mapping.api.CodeMapping
| coder.mapping.api.get
| find
| getDataDefault
| removeSignal
| setDataDefault
| setSignal
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)