Main Content

createCompositionAsModel

Create Simulink representation of AUTOSAR ARXML software composition

Description

example

createCompositionAsModel(ar,CompositionName) creates a Simulink® model corresponding to AUTOSAR software composition CompositionName. The composition 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 composition. The initial representation provides a starting point for further AUTOSAR configuration and Model-Based Design. For more information, see AUTOSAR ARXML Importer.

example

[mdl, sts] = createCompositionAsModel(ar,CompositionName,Name,Value) specifies additional options for Simulink model creation with one or more Name,Value pair arguments.

Examples

collapse all

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition')

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition. For components mySwc1 and mySwc2 contained within the composition, use existing Simulink component models rather than creating new ones.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition','ComponentModels',{'mySwc1','mySwc2'})

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition. Place Simulink data objects corresponding to AUTOSAR data types into data dictionary ardata.sldd.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition','DataDictionary','ardata.sldd')

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition. Model AUTOSAR periodic runnables as function-call subsystems with periodic rates.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition',...
  'ModelPeriodicRunnablesAs','FunctionCallSubsystem')

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition. Use PredefinedVariant Senior to resolve variation points in components at model creation time.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition',...
  'PredefinedVariant','/pkg/body/Variants/Senior');

Import AUTOSAR software composition /pkg/rootComposition from XML file mySWCs.arxml and create an initial Simulink representation of the composition. Use SwSystemconstantValueSets A and B to resolve variation points in components at model creation time.

ar = arxml.importer('mySWCs.arxml')
createCompositionAsModel(ar,'/pkg/rootComposition',...
  'SystemConstValueSets',{'/pkg/body/SystemConstantValues/A','/pkg/body/SystemConstantValues/B'});

Input Arguments

collapse all

AUTOSAR information previously imported from XML files, specified as an arxml.importer object handle.

Absolute short-name path of the software composition.

Example: '/Company/Powertrain/Components/RootComposition'

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'ModelPeriodicRunnablesAs','AtomicSubsystem' directs the importer to model AUTOSAR periodic runnables as atomic subsystems with periodic rates.

Names of existing atomic software component models to use when creating a Simulink representation of the composition. The function incorporates the specified existing component models in the composition model instead of creating new ones.

Example: 'ComponentModels',{'mySwc1','mySwc2'}

Simulink data dictionary into which to import data objects corresponding to AUTOSAR data types in the XML file. If the specified dictionary does not already exist, the importer creates it. The model is then associated with that data dictionary.

Example: 'DataDictionary','ardata.sldd'

By default, createCompositionAsModel imports AUTOSAR periodic runnables found in ARXML files and attempts to model them as atomic subsystems with periodic rates. If conditions prevent use of atomic subsystems, the function models the periodic runnables as function-call subsystems with periodic rates.

To model periodic runnables only as atomic subsystems, specify AtomicSubsystem. If conditions prevent use of atomic subsystems, the function throws an error.

To model periodic runnables only as function-call subsystems, specify FunctionCallSubsystem.

For more information, see Import AUTOSAR Software Component with Multiple Runnables.

Example: 'ModelPeriodicRunnablesAs','AtomicSubsystem'

Path to a PredefinedVariant defined in the AUTOSAR XML file. A PredefinedVariant describes a combination of system constant values among potentially multiple valid combinations to apply to AUTOSAR software components. Use this property to resolve variation points in AUTOSAR software components at 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'

Paths to one or more SystemConstValueSets defined in the AUTOSAR XML file. A SystemConstValueSet specifies a set of system constant values to apply to AUTOSAR software components. Use this property to resolve variation points in AUTOSAR software components at model creation time. If specified, the importer uses the SystemConstValueSets 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'}'

Output Arguments

collapse all

Variable that returns a handle to created model.

Variable that returns true if the import is successful. Otherwise, returns false.

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 to createCompositionAsModel and createComponentAsModel.

Introduced in R2017b