Main Content

createModel

Create Simulink implementation model for AUTOSAR architecture component or composition

Since R2020a

Description

createModel(component,modelName) creates Simulink® implementation model modelName with the same interface as the specified AUTOSAR architecture component and links the component to the implementation model. The component argument is a component handle returned by a previous call to addComponent. If not specified, modelName defaults to the name of the component.

example

createModel(composition,modelName) creates Simulink implementation model modelName with the same interface as the specified AUTOSAR architecture composition and links the composition to the implementation model. The composition argument is a composition handle returned by a previous call to addComposition. If not specified, modelName defaults to the name of the composition.

example

Examples

collapse all

For an AUTOSAR component in an architecture model, create a Simulink implementation model with a matching interface. The function call links the component to the implementation model. By default, the implementation model has the same name as the component.

% Create AUTOSAR architecture model
modelName = 'myArchModel';
archModel = autosar.arch.createModel(modelName);

% Add component inside the architecture model
component = addComponent(archModel,'SWC1');
addPort(component,'Sender',{'PPort1','PPort2'});

% Create and link matching Simulink implementation model
createModel(component);

For an AUTOSAR composition in an architecture model, create a Simulink implementation model with a matching interface. The function call links the composition to the implementation model. By default, the implementation model has the same name as the composition.

% Create AUTOSAR architecture model
modelName = 'myNewArchModel';
archModel = autosar.arch.createModel(modelName);

% Add composition inside the architecture model
composition = addComposition(archModel,'Sensors');
addPort(composition,'Sender',{'PPort1','PPort2'});

% Create and link matching Simulink implementation model
createModel(composition);

Input Arguments

collapse all

AUTOSAR architecture component from which to create a matching Simulink implementation model. The argument is a component handle returned by a previous call to addComponent.

Example: component

AUTOSAR architecture composition from which to create a matching Simulink implementation model. The argument is a component handle returned by a previous call to addComposition.

Example: composition

Name of the Simulink implementation model to create, based on the specified AUTOSAR architecture component or composition. If not specified, modelName defaults to the name of the component or composition.

Example: 'SWC1'

Version History

Introduced in R2020a