Main Content

linkToModel

Link AUTOSAR architecture component to Simulink implementation model

Since R2020a

Description

example

linkToModel(component,modelName) links the specified AUTOSAR architecture component to existing Simulink® implementation model modelName. The component inherits the interface of the linked implementation model. The component argument is a component handle returned by a previous call to addComponent.

Examples

collapse all

In an architecture model, link an AUTOSAR component to a Simulink® implementation model. The component inherits the interface of the linked implementation model.

Create AUTOSAR architecture model and add component inside the architecture model

modelName = 'myArchModel';
archModel = autosar.arch.createModel(modelName);
component = addComponent(archModel,'SWC1');

Load 'autosar_tpc_controller' model and programmatically set the XML Options Source to 'Inherit'.

load_system('autosar_tpc_controller.slx');
arProps = autosar.api.getAUTOSARProperties('autosar_tpc_controller');
set(arProps,'XmlOptions','XmlOptionsSource','Inherit');

Link to Simulink implementation model and inherit its interface

linkToModel(component,'autosar_tpc_controller');

Input Arguments

collapse all

AUTOSAR architecture component to link to the specified Simulink implementation model. The argument is a component handle returned by a previous call to addComponent.

Example: component

Name of an existing Simulink implementation model to link from the specified AUTOSAR architecture component.

Example: 'autosar_tpc_controller'

Version History

Introduced in R2020a