Main Content

autosar.api.create

Create or update mapped AUTOSAR component model

Description

example

autosar.api.create(model) creates or updates mapped AUTOSAR software component model model. The default function behavior depends on the mapping state of the model.

  • If the model is not mapped to an AUTOSAR software component, the function creates a Simulink® to AUTOSAR mapping in default mode. In this mapping, Simulink inports and outports are mapped to AUTOSAR ports with default AUTOSAR properties.

  • If the model is already mapped to an AUTOSAR software component, the function updates the existing mapping in incremental mode. The function finds and maps unmapped model elements, and updates the AUTOSAR Dictionary for deleted model elements.

example

autosar.api.create(model,mode) additionally specifies a mapping modedefault, init, or incremental.

example

autosar.api.create(model,mode,Name,Value) specifies additional options for mapping with one or more Name,Value pair arguments.

Examples

collapse all

Create AUTOSAR properties and Simulink to AUTOSAR mapping for an Embedded Coder® model in which the model configuration parameter System target file has been changed from ert.tlc to autosar.tlc or autosar_adaptive.tlc. Map model inports and outports to AUTOSAR ports with default AUTOSAR properties.

openExample('CounterModel');
set_param('CounterModel','SystemTargetFile','autosar.tlc');
autosar.api.create('CounterModel');

For a mapped AUTOSAR software component model, update the mapping to account for incremental model changes. Find and map unmapped model elements and update the AUTOSAR Dictionary for deleted model elements.

open_system('my_autosar_swc');
autosar.api.create('my_autosar_swc','incremental');

Create AUTOSAR properties and Simulink to AUTOSAR mapping for a submodel referenced from an AUTOSAR component model.

openExample('autosar_subcomponent');
autosar.api.create('autosar_subcomponent','default','ReferencedFromComponentModel',true);

Input Arguments

collapse all

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

Example: 'my_model'

The default mode value depends on the mapping state of the model — default for an unmapped model or incremental for a mapped model.

Specify default to create AUTOSAR properties and Simulink to AUTOSAR mapping for a model. As part of the mapping, the function maps model inports and outports to AUTOSAR ports with default AUTOSAR properties. If the model is already mapped, the function overwrites the existing mapping.

Specify init to create AUTOSAR properties and Simulink to AUTOSAR mapping for a model. As part of the mapping, the function does not map model inports and outports. If the model is already mapped, the function overwrites the existing mapping.

Specify incremental to update the existing mapping in a mapped AUTOSAR software component model. The function finds and maps unmapped model elements and updates the AUTOSAR Dictionary for deleted model elements.

Example: 'default'

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'ReferencedFromComponentModel',true maps a model as a referenced submodel.

Specify whether the model is a submodel referenced from an AUTOSAR software component model. In a mapped submodel, you can use the Code Mappings editor to configure the submodel internal data for calibration.

Example: 'ReferencedFromComponentModel',true

Version History

Introduced in R2013b