Main Content

getSignal

Get code and calibration configuration from code mappings for block output signal

Since R2020b

    Description

    propertyValue = getSignal(myCodeMappingObj,portHandle,property) 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-level Inport blocks. For signals that originate from root-level Inport blocks, see getInport.

    example

    Examples

    collapse all

    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");

    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");

    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

    collapse all

    Code mapping object (model code mappings) returned by a call to function coder.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 ReturnProperty Name
    Name of storage classStorageClass
    Name of variable for signal data in the generated codeIdentifier
    Name of source definition file that contains definitions for global data that is read by the signal data and external codeDefinitionFile
    Name of get function called by code generated for the signal dataGetFunction
    Name of source header file that contains declarations for global data that is read by the signal data and external codeHeaderFile
    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 arrayPerserveDimensions
    Name of set function called by code generated for a signal dataSetFunction
    Name of structure in generated code for a signal dataStructName
    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 toolBitMask
    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 propertyCalibrationAccess
    Name of the conversion method used during the calibrationCompuMethod
    Optional display name of the signal for calibrationDisplayIdentifier
    Specifies the display format of the signal being measured in a calibration toolFormat
    Name of measurement service defined in Embedded Coder DictionaryMeasurementService

    Example: "StorageClass"

    Example: "CalibrationAccess"

    Output Arguments

    collapse all

    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