Main Content

autosar.api.getSimulinkMapping

Map Simulink elements to AUTOSAR elements

Description

In an AUTOSAR software component model, use AUTOSAR map functions to map model elements to AUTOSAR component elements from a Simulink® model perspective. In an AUTOSAR adaptive model, use AUTOSAR map functions to configure generated C++ class names and namespaces for your adaptive application. For example, you can:

  • Map a Simulink entry-point function to an AUTOSAR runnable and optional software address methods.

  • Map a Simulink inport or outport to an AUTOSAR receiver or sender port and a sender-receiver data element.

  • Map a Simulink model workspace parameter to an AUTOSAR component parameter.

  • Map a Simulink data store to an AUTOSAR variable.

  • Add or remove Simulink block signals from AUTOSAR component mapping.

  • Map a Simulink block signal or state to an AUTOSAR variable.

  • Set the default data packaging for Simulink internal data stores, signals, and states in AUTOSAR generated code.

  • Map a Simulink data transfer line to an AUTOSAR inter-runnable variable (IRV).

  • Map a Simulink function caller to an AUTOSAR client port and a client-server operation.

  • Control generated C++ class name or namespace for adaptive applications.

Creation

Description

example

slMap = autosar.api.getSimulinkMapping(model) creates object slMap, which represents AUTOSAR mapping information for model. The specified model must be open.

Input Arguments

expand all

Model for which to create AUTOSAR mapping object, specified as a handle, character vector, or string scalar representing the model name.

Example: 'my_model'

Object Functions

addSignalAdd Simulink block signal to AUTOSAR mapping
findFind AUTOSAR elements
getClassNameGet class name of model
getClassNamespaceGet class namespace for a model
getDataStoreGet AUTOSAR mapping information for Simulink data store
getDataTransferGet AUTOSAR mapping information for Simulink data transfer
getFunctionGet AUTOSAR mapping information for Simulink entry-point function
getFunctionCallerGet AUTOSAR mapping information for Simulink function-caller block
getInportGet AUTOSAR mapping information for Simulink inport
getInternalDataPackagingGet default internal data packaging for AUTOSAR component model
getOutportGet AUTOSAR mapping information for Simulink outport
getParameterGet AUTOSAR mapping information for Simulink model workspace parameter
getSignalGet AUTOSAR mapping information for Simulink block signal
getStateGet AUTOSAR mapping information for Simulink block state
mapDataStoreMap Simulink data store to AUTOSAR variable
mapDataTransferMap Simulink data transfer to AUTOSAR inter-runnable variable
mapFunctionMap Simulink entry-point function to AUTOSAR runnable and software address methods
mapFunctionCallerMap Simulink function-caller block to AUTOSAR client port and operation
mapInportMap Simulink inport to AUTOSAR port
mapOutportMap Simulink outport to AUTOSAR port
mapParameterMap Simulink model workspace parameter to AUTOSAR component parameter
mapSignalMap Simulink block signal to AUTOSAR variable
mapStateMap Simulink block state to AUTOSAR variable
removeSignalRemove Simulink block signal from AUTOSAR mapping
setClassNameSet class name of model
setClassNamespaceSet class namespace of model
setInternalDataPackagingSet default internal data packaging for AUTOSAR component model

Examples

collapse all

Call the autosar.api.getSimulinkMapping function to create object slMap, which represents AUTOSAR mapping information for model autosar_swc. Use the returned object to map the Simulink initialize entry-point function to AUTOSAR runnable Runnable_Init.

hModel = 'autosar_swc';
openExample(hModel);
slMap = autosar.api.getSimulinkMapping(hModel);
mapFunction(slMap,'Initialize','Runnable_Init');
arRunnableName = getFunction(slMap,'Initialize')
arRunnableName =
    'Runnable_Init'

Version History

Introduced in R2013b