importFromARXML
Syntax
Description
importFromARXML(
imports composition archModel
,arxmlInput
,compQName
)compQName
from arxmlInput
into
architecture model archModel
. The archModel
argument is an architecture model handle returned by a previous call to
autosar.arch.createModel
or
autosar.arch.loadModel
. Composition import requires an open AUTOSAR
architecture model with no functional content.
importFromARXML(
specifies additional import options with one or more archModel
,arxmlInput
,compQName
,Name,Value
)Name,Value
pair
arguments. You can specify:
Whether to include or exclude AUTOSAR software components, which define composition behavior. By default, the import includes components within the composition.
Simulink® data dictionary in which to place data objects for imported AUTOSAR data types.
Names of existing Simulink behavior models to link to imported AUTOSAR software components.
Component options to apply when creating Simulink behavior models for imported AUTOSAR software components. For example, how to model periodic runnables, or a
PredefinedVariant
orSwSystemconstantValueSet
s with which to resolve component variation points.
Examples
Import AUTOSAR Composition to Architecture Model
This example:
Creates AUTOSAR architecture model
myArchModel
.Imports software composition
/Company/Components/ThrottlePositionControlComposition
from AUTOSAR example fileThrottlePositionControlComposition.arxml
into the architecture model.
The ARXML file is located at
,
which is on the default MATLAB® search path.matlabroot
/examples/autosarblockset/data
% Create AUTOSAR architecture model modelName = "myArchModel"; archModel = autosar.arch.createModel(modelName); % Import composition from file ThrottlePositionControlComposition.arxml importerObj = arxml.importer("ThrottlePositionControlComposition.arxml"); % Parse ARXML importFromARXML(archModel,importerObj,... "/Company/Components/ThrottlePositionControlComposition");
Creating model 'ThrottlePositionSensor' for component 1 of 5: /Company/Components/ThrottlePositionSensor Creating model 'ThrottlePositionMonitor' for component 2 of 5: /Company/Components/ThrottlePositionMonitor Creating model 'Controller' for component 3 of 5: /Company/Components/Controller Creating model 'AccelerationPedalPositionSensor' for component 4 of 5: /Company/Components/AccelerationPedalPositionSensor Creating model 'ThrottlePositionActuator' for component 5 of 5: /Company/Components/ThrottlePositionActuator Importing composition 1 of 1: /Company/Components/ThrottlePositionControlComposition
Import AUTOSAR Composition and Link Existing Component Models
This example shows the function call syntax to:
Create an AUTOSAR architecture model with no functional content.
Import AUTOSAR software composition
/pkg/rootComposition
from a file namedmySWCs.arxml
into the architecture model.For software components
mySwc1
andmySwc2
contained within the composition, link existing Simulink component models rather than creating new ones.
% Create AUTOSAR architecture model modelName = "myArchModel"; archModel = autosar.arch.createModel(modelName); % Import composition from ARXML file and link existing component models importFromARXML(archModel,"mySWCs.arxml",'/pkg/rootComposition',... "ComponentModels",{'mySwc1','mySwc2'})
Import AUTOSAR Composition and Use Component PredefinedVariant
This example shows the function call syntax to:
Create an AUTOSAR architecture model with no functional content.
Import AUTOSAR software composition
/CompositionType/myComposition
from a file namedmyComposition.arxml
into the architecture model.For each software component contained within the composition, at component model creation time, use
PredefinedVariant
Senior to resolve variation points in the component.
% Create AUTOSAR architecture model modelName = "myArchModel"; archModel = autosar.arch.createModel(modelName); % Import composition from ARXML file and use PredefinedVariant for components importerObj = arxml.importer("MyComposition.arxml"); % Import AUTOSAR information importFromARXML(archModel,importerObj,"/CompositionType/myComposition",... "PredefinedVariant","/pkg/body/Variants/Senior"););
Input Arguments
archModel
— Architecture model
handle
AUTOSAR architecture model into which to import the specified composition. The
argument is an architecture model handle returned by a previous call to
autosar.arch.createModel
or
autosar.arch.loadModel
.
Example: archModel
arxmlInput
— arxml.importer
object or ARXML file names
handle | character vector | string scalar | cell array of character vectors | string array
ARXML files from which to import the specified composition, specified as one of the following:
A handle to AUTOSAR information imported from ARXML files, previously returned by
.importerObj
= arxml.importer(arxmlFiles
)One or more ARXML file names.
Example: importerObj
,
"myComposition.arxml"
compQName
— Composition path
character vector | string scalar | cell array of character vectors | string array
Absolute short-name path (qualified name) of the composition to import into the specified composition or architecture model.
Example: "/CompositionType/myComposition"
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: "DataDictionary","ardata.sldd"
directs the importer to place
data objects corresponding to imported AUTOSAR data types in the specified Simulink data dictionary.
ComponentModels
— Simulink component models
cell array of character vectors | string array
Names of existing atomic software component models to link when creating a Simulink representation of the composition. For components contained within the composition, link the specified component behavior models instead of creating new ones.
Example: "ComponentModels",{'mySwc1','mySwc2'}
DataDictionary
— Simulink data dictionary
character vector | string scalar
Simulink data dictionary in which to place data objects corresponding to imported AUTOSAR data types. If the specified dictionary does not exist, the importer creates it. The composition and its components are then associated with that data dictionary.
Example: "DataDictionary","ardata.sldd"
ExcludeInternalBehavior
— Suppress component import
false
(default) | true
Specify whether to allow (default) or suppress the import of software components
that define the behavior of the composition. If component import is suppressed
(true
), the import still links models specified by the
ComponentModels
argument.
Example: "ExcludeInternalBehavior",true
ImportCompositionAs
— For imported compositions, define as model or subsystem
"Model"
| "Subsystem"
To represent imported compositions as a model, specify Model
.
To represent imported compositions as a subsystem, specify
Subsystem
.
Example: "ImportCompositionAs","Model"
ModelPeriodicRunnablesAs
— For imported components, subsystem type for periodic runnables
"AtomicSubsystem"
(default) | "FunctionCallSubsystem"
| "Auto"
By default, when importing a software component contained within a composition,
importFromARXML
imports AUTOSAR periodic runnables found in the
ARXML files and models them as atomic subsystems with periodic rates. If conditions
prevent use of atomic subsystems, the importer throws an error.
To model periodic runnables as function-call subsystems with periodic rates,
specify FunctionCallSubsystem
.
If you specify Auto
, the importer attempts to model periodic
runnables as atomic subsystems. If conditions prevent use of atomic subsystems, the
importer models periodic runnables as function-call subsystems.
For more information, see Import AUTOSAR Software Component with Multiple Runnables.
Example: "ModelPeriodicRunnablesAs","AtomicSubsystem"
PredefinedVariant
— For imported components, path to AUTOSAR predefined variant
character vector | string scalar
Path to a PredefinedVariant
defined in the ARXML files. A
PredefinedVariant
describes a combination of system constant
values among potentially multiple valid combinations to apply to an AUTOSAR software
component. Use this property to resolve variation points in the AUTOSAR software
component at component model creation time. If specified, the importer uses the
PredefinedVariant
to initialize SwSystemconst
data that serves as input to control variation points.
For more information, see Control AUTOSAR Variants with Predefined Value Combinations.
Example: "PredefinedVariant",'/pkg/body/Variants/Senior'
SystemConstValueSets
— For imported components, paths to one or more AUTOSAR system constant value sets
cell array of character vectors | string array
Paths to one or more SystemConstValueSet
s defined in the ARXML
files. A SystemConstValueSet
specifies a set of system constant
values to apply to an AUTOSAR software component. Use this property to resolve
variation points in the AUTOSAR software component at component model creation time.
If specified, the importer uses the SystemConstValueSet
s to
initialize SwSystemconst
data that serves as input to control
variation points.
For more information, see Control AUTOSAR Variants with Predefined Value Combinations.
Example: 'SystemConstValueSets','{'/pkg/body/SystemConstantValues/A','/pkg/body/SystemConstantValues/B'}'
UseFunctionPorts
— Option to use Simulink function ports
false
or 0
(default) | true
or 1
Option to import client-server ports as Simulink function ports, specified as a numeric or logical
1
(true
) or
0
(false
).
true
— Port-scoped Simulink functions and function callers are used.false
— Global Simulink functions and function callers are used.
Example: "UseFunctionPorts"=true
Data Types: logical
Version History
Introduced in R2020bR2024b: Import client-server ports as Simulink function ports for client-server communication
Starting in R2024b, you can specify the name-value argument UseFunctionPorts
to use port-scoped Simulink functions and function callers.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)