주요 콘텐츠

mapParameter

Map Simulink model workspace parameter to AUTOSAR component parameter

Description

mapParameter(slMap,slParameter,arParamType) maps the Simulink® model workspace parameter slParameter to an AUTOSAR parameter of type arParamType for AUTOSAR run-time calibration. AUTOSAR parameter types include SharedParameter, PerInstanceParameter, ConstantMemory, and PortParameter.

example

mapParameter(slMap,slParameter,arParamType,Name,Value) specifies additional properties for an AUTOSAR SharedParameter, PerInstanceParameter, ConstantMemory, or PortParameter by using one or more Name,Value pair arguments.

Examples

collapse all

Set AUTOSAR mapping and property information for Simulink model workspace parameters K and INC in example model autosar_swc_counter.

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

mapParameter(slMap,'K','SharedParameter')
arMappedTo = getParameter(slMap,'K')
arValue = getParameter(slMap,'K','SwCalibrationAccess')

mapParameter(slMap,'INC','ConstantMemory','SwCalibrationAccess','ReadOnly')
arMappedTo = getParameter(slMap,'INC')
arValue = getParameter(slMap,'INC','SwCalibrationAccess')
arMappedTo =
    'SharedParameter'

arValue =
    'ReadWrite'

arMappedTo =
    'ConstantMemory'

arValue =
    'ReadOnly'

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

Name of the Simulink model workspace parameter for which to set AUTOSAR mapping information.

Example: 'INC'

Type of AUTOSAR component parameter to which to map the specified Simulink model workspace parameter. Valid AUTOSAR parameter types include SharedParameter, PerInstanceParameter, ConstantMemory, PortParameter, and Auto. To accept software mapping defaults, specify Auto.

Example: 'SharedParameter'

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'SwCalibrationAccess','ReadOnly' specifies read-only access to the parameter for run-time calibration.

Name of a parameter interface data element configured in the AUTOSAR Dictionary, specified as a character vector or string scalar.

Example: 'DataElement','ParamElement1'

Display format for the AUTOSAR parameter, specified as a character vector or string scalar. AUTOSAR display format specifications control the width and precision display for calibration and measurement data. For more information, see Configure DisplayFormat.

Example: 'DisplayFormat','%2.6f'

Whether to include C type qualifier const in generated code for the AUTOSAR parameter, specified as a character vector or string scalar.

Example: 'IsConst','true'

Whether to include C type qualifier volatile in generated code for the AUTOSAR parameter, specified as a character vector or string scalar.

Example: 'IsVolatile','true'

Name of a parameter receiver port configured in the AUTOSAR Dictionary, specified as a character vector or string scalar.

Example: 'Port','myParamPort'

Optional AUTOSAR additional native type qualifier to include in generated code for the AUTOSAR parameter, specified as a character vector or string scalar.

Example: 'Qualifier','test_qualifier'

Short name for the AUTOSAR parameter, specified as a character vector or string scalar. If unspecified, ARXML export generates a short name based on the Simulink parameter name. Short names are not supported for port-based parameters (PortParameter) since the port name can be used across multiple applications.

Example: "SM_equal_to_count"

SwAddrMethod name that is valid for the AUTOSAR parameter, specified as a character vector or string scalar. Code generation uses the SwAddrMethod name to group AUTOSAR parameters in a memory section for access by calibration and measurement tools. For a list of valid SwAddrMethod values for the parameter, see the Code Mappings editor, Parameters tab. For more information, see Configure SwAddrMethod.

Example: 'SwAddrMethod','CONST'

How calibration and measurement tools can access the AUTOSAR parameter, specified as a character vector or string scalar. Valid access values include ReadOnly, ReadWrite, and NotAccessible. For more information, see Configure SwCalibrationAccess.

Example: 'SwCalibrationAccess','ReadOnly'

Headline for the AUTOSAR parameter, specified as a character vector or string scalar.

Example: 'LongName','Position of Engine Throttle'

Version History

Introduced in R2018b

expand all