Main Content

getSignal

Get AUTOSAR mapping information for Simulink block signal

Description

example

arValue = getSignal(slMap,slPortHandle) returns the type of AUTOSAR variable mapped to the named or test-pointed Simulink® block signal associated with outport port handle slPortHandle. AUTOSAR variable types include ArTypedPerInstanceMemory and StaticMemory.

arValue = getSignal(slMap,slPortHandle,arProperty) returns the value of property arProperty for the AUTOSAR variable to which the Simulink block signal is mapped.

Examples

collapse all

Get AUTOSAR mapping and property information for the Simulink block signals for blocks RelOpt and Sum in example model autosar_swc_counter.

hModel = 'autosar_swc_counter';
openExample(hModel);
slMap = autosar.api.getSimulinkMapping(hModel);

portHandles = get_param('autosar_swc_counter/RelOpt','portHandles');
outportHandle = portHandles.Outport;
mapSignal(slMap,outportHandle,'StaticMemory')
arMappedTo = getSignal(slMap,outportHandle)
arValue = getSignal(slMap,outportHandle,'SwCalibrationAccess')

portHandles = get_param('autosar_swc_counter/Sum','portHandles');
outportHandle = portHandles.Outport;
mapSignal(slMap,outportHandle,'ArTypedPerInstanceMemory',...
    'SwCalibrationAccess','ReadWrite')
arMappedTo = getSignal(slMap,outportHandle)
arValue = getSignal(slMap,outportHandle,'SwCalibrationAccess')
arMappedTo =
    'StaticMemory'

arValue =
    'ReadOnly'

arMappedTo =
    'ArTypedPerInstanceMemory'

arValue =
    'ReadWrite'

Input Arguments

collapse all

Simulink to AUTOSAR mapping information for a model, previously returned by slMap = autosar.api.getSimulinkMapping(model). model is a handle, character vector, or string scalar representing the model name.

Example: slMap

Outport port handle for a named or test-pointed Simulink block signal to return AUTOSAR mapping information for. Use MATLAB® commands to construct the outport port handle. For example, for a Relational Operator block named RelOpt:

portHandles = get_param('autosar_swc_counter/RelOpt','portHandles');
outportHandle = portHandles.Outport;

Example: outportHandle

Name of AUTOSAR variable property. Valid property names include ShortName, SwAddrMethod, SwCalibrationAccess, DisplayFormat, and LongName. For StaticMemory, you can also specify C type qualifier properties IsVolatile or Qualifier (AUTOSAR additional native type qualifier). For property descriptions, see mapSignal.

Example: 'SwCalibrationAccess'

Output Arguments

collapse all

Variable that returns either the type of the mapped AUTOSAR variable or the value of a variable property.

Example: arValue

Version History

Introduced in R2018b