Main Content

mapFunctionCaller

Map Simulink function-caller block to AUTOSAR client port and operation

Description

example

mapFunctionCaller(slMap,slFcnName,arPortName,arOperationName) maps the Simulink® function-caller block for Simulink function slFcnName to AUTOSAR client port arPortName and AUTOSAR operation arOperationName.

If your model has multiple callers of Simulink function slFcnName, this function maps all of them to the AUTOSAR client port and operation.

Examples

collapse all

Set AUTOSAR mapping information for a function-caller block in a model in which AUTOSAR client function invocation is being modeled. The model has a function-caller block for Simulink function readData.

addpath(fullfile(matlabroot,'/help/toolbox/autosar/examples'));
hModel = 'mControllerWithInterface_client';
open_system(hModel);
slMapC = autosar.api.getSimulinkMapping(hModel);
mapFunctionCaller(slMapC,'readData','cPort','readData');
[arPort,arOp] = getFunctionCaller(slMapC,'readData')
arPort =
cPort

arOp =
readData

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 function for the function-caller block for which to set AUTOSAR mapping information.

Example: 'readData'

Name of the AUTOSAR client port to which to map the specified function-caller block.

Example: 'cPort'

Name of the AUTOSAR operation to which to map the specified function-caller block.

Example: 'readData'

Introduced in R2014b