getSignal

Get code configuration from code mappings for block output signal

    Description

    example

    propertyValue = getSignal(myCodeMappingObj,portHandle,property) returns the value of a code mapping property for the signal specified by a block output port handle. Use this function to return the name of the storage class or the value of a storage class 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.

    Examples

    collapse all

    From the model code mappings for model myConfigModel, get the name of the storage class that is configured for the output signal of lookup table block Table1D. 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.

    cm = coder.mapping.api.get('myConfigModel');
    lut1D_ports = get_param('myConfigModel/Table1D','PortHandles');
    lut1D_outPort = lut1D_ports.Outport;
    scTable1D = getSignal(cm,lut1D_outPort,'StorageClass');
    

    From the model code mappings for model myConfigModel, get the code identifiers that are configured for output signals of lookup table blocks Table1D and Table2D. 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.

    cm = coder.mapping.api.get('myConfigModel');
    lut1D_ports = get_param('myConfigModel/Table1D','PortHandles');
    lut2D_ports = get_param('myConfigModel/Table2D','PortHandles');
    lut1D_outPort = lut1D_ports.Outport;
    lut2D_outPort = lut2D_ports.Outport;
    idTable1D = getSignal(cm,lut1D_outPort,'Identifier');
    idTable2D = getSignal(cm,lut3D_outPort,'Identifier');
    

    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. Specify one of these property names or a property name for a storage class defined in the Embedded Coder Dictionary associated with the model.

    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 signal data shared by multiple models in a model hierarchy Owner
    Boolean value indicating whether code generator preserves dimensions of signal data that is represented as a multidimensional arrayPerserveDimensions
    Name of set function called by code generated for the signal dataSetFunction
    Name of structure in generated code for signal dataStructName

    Example: 'StorageClass'

    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

    Introduced in R2020b