Main Content

mapDataTransfer

Map Simulink data transfer to AUTOSAR inter-runnable variable

Description

mapDataTransfer(slMap,slDataTransfer,arIrvName,arDataAccessMode) maps the Simulink® data transfer line or Rate Transition block slDataTransfer to AUTOSAR inter-runnable variable arIrvName and AUTOSAR data access mode arDataAccessMode.

example

Examples

collapse all

Set AUTOSAR mapping information for a data transfer line in the example model autosar_swc_expfcns. The model has data transfer lines named irv1, irv2, irv3, and irv4. This example changes the AUTOSAR data access mode for irv4 from Implicit to Explicit.

hModel = 'autosar_swc_expfcns';
open_system(hModel);
slMap=autosar.api.getSimulinkMapping(hModel);
mapDataTransfer(slMap,'irv4','IRV4','Explicit');
[arIrvName,arDataAccessMode]=getDataTransfer(slMap,'irv4')
arIrvName = 
'IRV4'
arDataAccessMode = 
'Explicit'

Set AUTOSAR mapping information for a Rate Transition block in the example model mMultitasking_4rates. The model has Rate Transition blocks named RateTransition, RateTransition1, and RateTransition2, which are located at the top level of the model. This example changes the AUTOSAR data access mode for RateTransition from Implicit to Explicit.

hModel = 'mMultitasking_4rates';
open_system(hModel);
slMap=autosar.api.getSimulinkMapping(hModel);
mapDataTransfer(slMap,'mMultitasking_4rates/RateTransition','IRV1','Explicit');
[arIrvName,arDataAccessMode]=getDataTransfer(slMap,'mMultitasking_4rates/RateTransition')
arIrvName = 
'IRV1'
arDataAccessMode = 
'Explicit'

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 data transfer line or full block path to the Rate Transition block for which to set AUTOSAR mapping information.

Example: 'irv4'

Example: 'myModel/RateTransition2'

Name of the AUTOSAR inter-runnable variable to which to map the specified Simulink data transfer.

Example: 'IRV4'

Value of the AUTOSAR data access mode to which to map the specified Simulink data transfer. The value can be Implicit or Explicit.

Example: 'Explicit'

Version History

Introduced in R2013b