getSignal - Get code and calibration configuration from code mappings for block output
signal - MATLAB ([original](https://www.mathworks.com/help/ecoder/ref/getsignal.html)) ([raw](?raw))
Get code and calibration configuration from code mappings for block output signal
Since R2020b
Syntax
Description
[propertyValue](#mw%5F4fdcdfac-36a0-46bb-8358-4a83e4138ab8) = getSignal([myCodeMappingObj](#mw%5Ff10157b8-e1fe-4fb6-8929-8b08e40da27e),[portHandle](#mw%5Fd19348e4-37d1-48ad-a488-98acec2a68a7),[property](#mw%5F8d842b77-a2ce-4685-937b-b5cc558b5309))
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.
This function does not apply to signals that originate from root-levelInport blocks. For signals that originate from root-levelInport blocks, see getInport.
Examples
From the model code mappings for modelConfigurationRapidPrototypingInterface
, get the name of the storage class that is configured for the output signal of lookup table blockTable1
. 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");
From the model code mappings for modelConfigurationRapidPrototypingInterface
, get the code identifiers that are configured for output signals of lookup table blocks Table1
andTable2
. 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");
From the model code mappings for modelConfigurationRapidPrototypingInterface
, 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
Code mapping object (model code mappings) returned by a call to functioncoder.mapping.api.get
.
Example: myCM
Block output signals for which to return signal code mapping information.
Example: portHandle
Data Types: port_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 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
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