Main Content

mapLookupTable

Map Simulink base workspace lookup table or breakpoint object to AUTOSAR parameter

For run-time calibration of AUTOSAR parameters and lookup tables, R2019a introduced graphical mapping of model workspace parameters to AUTOSAR component parameters by using the Code Mappings editor. If you currently model AUTOSAR lookup tables by using AUTOSAR base-workspace parameters with the mapping functions getLookupTable and mapLookupTable, consider switching to using Simulink® model-workspace parameters with either the Code Mappings editor Parameters tab or the mapping functions getParameter and mapParameter. For more information, see Map Model Workspace Parameters to AUTOSAR Component Parameters and Configure Lookup Tables for AUTOSAR Calibration and Measurement.

Description

mapLookupTable(slMap,slParam,arParameterAccessMode,arPortName,arParameterData) maps the Simulink lookup table slParam to the AUTOSAR parameter data item arParameterData and, if defined, AUTOSAR parameter receiver port arPortName. The AUTOSAR parameter access mode for the parameter is set to arParameterAccessMode.

Use this function only for lookup tables described by Simulink lookup table and breakpoint data objects in the base workspace.

example

Examples

collapse all

Set AUTOSAR mapping information for Simulink lookup tables. The model has lookup tables named L_4x6_single and L_4_single. This example:

  • Maps Simulink lookup table L_4x6_single to AUTOSAR parameter data item L_4x6_single_ar, which the AUTOSAR software component defines and accesses internally. (The parameter is not associated with a port-based parameter interface.) Parameter L_4x6_single_ar uses Shared parameter access mode.

  • Maps Simulink lookup table L_4_single to AUTOSAR parameter data item prmDE1, which is a data element associated with AUTOSAR parameter receiver port prmRPort1. Parameter prmDE1 uses PortParameter parameter access mode.

open_system('mySWC')
slMap=autosar.api.getSimulinkMapping('mySWC');
mapLookupTable(slMap,'L_4x6_single','Shared','','L_4x6_single_ar');
[arParameterAccessMode,arPortName,arParameterData]=getLookupTable(slMap,'L_4x6_single')
arParameterAccessmode =
Shared

arPortName =
''

arParameterData =
L_4x6_single_ar
mapLookupTable(slMap,'L_4_single','PortParameter','prmRPort1','prmDE1');
[arParameterAccessMode,arPortName,arParameterData]=getLookupTable(slMap,'L_4_single')
arParameterAccessmode =
PortParameter

arPortName =
prmRPort1

arParameterData =
prmDE1

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 lookup table for which to set AUTOSAR mapping information.

Example: 'L_4x6_single'

Value of the AUTOSAR parameter access mode to which to map the specified Simulink lookup table. The value can be PortParameter, Shared, PerInstance, or Const.

Example: 'Shared'

Name of the AUTOSAR parameter receiver port to which to map the specified Simulink lookup table. If the parameter is internal to the AUTOSAR software component, and not associated with a port-based parameter interface, specify ''.

Example: 'PrmRPort1'

Name of the AUTOSAR parameter data item to which to map the specified Simulink lookup table. The parameter can be internal to the AUTOSAR software component or associated with a port-based parameter interface.

Example: 'prmDE1'

Version History

Introduced in R2016b