createComponentAsModel
Create Simulink representation of AUTOSAR ARXML atomic software component
Syntax
Description
[
creates a Simulink® model that corresponds to the AUTOSAR atomic software component
model
,status
] = createComponentAsModel(ar
,ComponentName
)ComponentName
, and returns a handle to the model,
represented by model
, and a status indicating whether the
action was successful, represented by
status
.
The component description is part of AUTOSAR information previously imported from
AUTOSAR XML (ARXML) files, that are represented by the arxml.importer
object ar
. The importer creates an
initial Simulink representation of the imported AUTOSAR component, with an initial
default mapping of Simulink model elements to AUTOSAR component elements. This initial
representation provides a starting point for further AUTOSAR configuration and
Model-Based Design. For more information, see AUTOSAR ARXML Importer.
The initial representation of AUTOSAR component behavior in the created model depends on the ARXML description:
If the ARXML description of the component does not describe component behavior, the importer creates a model with a default representation of AUTOSAR runnables and ports.
If the ARXML description of the component describes component behavior, the importer creates a model based on AUTOSAR elements that are accessed in the component.
For example, AUTOSAR ports must be accessed by runnables in order to generate the corresponding Simulink elements. If a sender-receiver or client-server port in ARXML is not accessed by a runnable, the importer does not create the corresponding inports, outports, or Simulink functions.
[
specifies options using one or more name-value arguments. For example, to direct the
importer to model AUTOSAR periodic runnables as atomic subsystems with periodic
rates, set model
,status
] = createComponentAsModel(ar
,ComponentName
,Name=Value
)ModelPeriodicRunnablesAs
to
"AtomicSubsystem"
.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
If you enter the
arxml.importer
object function call without a terminating semicolon, the importer lists the AUTOSAR content of the specified ARXML file or files. The information includes paths to software components in the AUTOSAR package structure, which you can specify in calls tocreateComponentAsModel
andimportFromARXML
.When importing an AUTOSAR software component into a model, it is recommended that you explicitly specify the
ModelPeriodicRunnablesAs
argument.