createComponentAsModel
Create Simulink representation of AUTOSAR ARXML atomic software component
Syntax
Description
createComponentAsModel(
creates a Simulink® model corresponding to AUTOSAR atomic software component
ar
,ComponentName
)ComponentName
. The component description is part of AUTOSAR
information previously imported from AUTOSAR XML files, which is represented by
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. The 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 XML description:
If the XML 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 XML 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 XML code is not accessed by a runnable, the importer does not create the corresponding inports, outports, or Simulink functions.
[
specifies additional options for Simulink model creation with one or more mdl
, sts
] = createComponentAsModel(ar
,ComponentName
,Name,Value
)Name,Value
pair
arguments.
Examples
Input 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 XML file or files. The information includes paths to software components in the AUTOSAR package structure, which you can specify in calls tocreateComponentAsModel
andcreateCompositionAsModel
.When importing an AUTOSAR software component into a model, it is recommended that you explicitly specify the
'ModelPeriodicRunnablesAs'
argument. This argument determines how the importer models AUTOSAR periodic runnables in the created model. See the argument description under Name-Value Arguments.