Main Content

createCompositionasmodel

Create万博1manbetxrepresentation of AUTOSAR ARXML software composition

Description

例子

createCompositionSmodel(ar,,,,构图名创建一个模拟万博1manbetx®对应于Autosar软件组成的型号构图名。这composition description is part of AUTOSAR information previously imported from AUTOSAR XML files, which is represented byarxml.importer目的ar创建一个初始模型,进口国翅万博1manbetxtation of the imported AUTOSAR composition. The initial representation provides a starting point for further AUTOSAR configuration and Model-Based Design. For more information, see一个UTOSAR ARXML Importer

例子

[[mdl,,,,sts] = createCompositionAsModel(ar,,,,构图名,,,,姓名,,,,Value指定使用一个或多个模型创建的其他选项万博1manbetx姓名,,,,Valuepair arguments.

Examples

collapse all

Import AUTOSAR software composition/Company/Components/ThrottlePositionControlCompositionfrom the fileThrottlePositionControlComposition.arxml。这一个RXML file is located atmatlabroot/examples/autosarblockset/data,在默认MATLAB上®path. Create an initial Simulink representation of the composition.

ar = arxml.importer('thorottlePositionControlComposition.arxml'); names = getComponentNames(ar,'作品'
names = 1×1 cell array {'/Company/Components/ThrottlePositionControlComposition'}
createCompositionSmodel(ar,'/company/组件/throttlePositionControlComposition');

Import AUTOSAR software composition/pkg/rootCompositionfrom XML filemySWCs.arxml并创建组合物的初始模拟表示。万博1manbetxFor componentsmySwc1andmySwc2包含在构图中,使用现有的Simulink组件模型,而不是创建新的模型。万博1manbetx

ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,“ componentModels”,,,,{'myswc1',,,,'myswc2'})

Import AUTOSAR software composition/pkg/rootCompositionfrom XML filemySWCs.arxml并创建组合物的初始模拟表示。万博1manbetx将与Auto万博1manbetxSar数据类型相对应的Simulink数据对象放入数据字典中ardata.sldd

ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,'Datadictionary',,,,'ardata.sldd'

Import AUTOSAR software composition/Company/Components/ThrottlePositionControlCompositionfrom the fileThrottlePositionControlComposition.arxml。这一个RXML file is located atmatlabroot/examples/autosarblockset/data,在默认MATLAB上path. Create an initial Simulink representation of the composition.

对于每个导入的组件,进口商在数据字典中存储可共享的汽车属性,例如接口和数据类型ardata.sldd。Components within the composition can then share the stored properties.

ar = arxml.importer('thorottlePositionControlComposition.arxml')createCompositionSmodel(ar,'/company/组件/throttlePositionControlComposition',,,,...'ModelPeriodicRunnablesAs',,,,'汽车',,,,...'Datadictionary',,,,'ardata.sldd',,,,“ ShareAutoSarproperties”,真的);

To view the shared properties, open the AUTOSAR dictionary for a component model. This example opensThrottlePositionSensor。Expand the AUTOSAR dictionary nodeardata.sldd。You can view read-only properties, such as shared component interfaces, and modify XML options for composition and component export.

autosar_ui_launch(“ ThrottlePositionSensor”

Import AUTOSAR software composition/pkg/rootCompositionfrom XML filemySWCs.arxml并创建组合物的初始模拟表示。万博1manbetx模型AutoSar周期可运行物作为具有周期性速率的功能通用子系统。

ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,...'ModelPeriodicRunnablesAs',,,,'FunctionCallSubsystem'

Import AUTOSAR software composition/pkg/rootCompositionfrom XML filemySWCs.arxml并创建组合物的初始模拟表示。万博1manbetxUsePredefinedVariantSenior to resolve variation points in components at model creation time.

ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,...“预定变量”,,,,'/pkg/身体/变体/高级');

Import AUTOSAR software composition/pkg/rootCompositionfrom XML filemySWCs.arxml并创建组合物的初始模拟表示。万博1manbetxUseSwSystemconstantValueSets A and B to resolve variation points in components at model creation time.

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

Input Arguments

collapse all

一个UTOSAR information previously imported from XML files, specified as anarxml.importer对象句柄。

一个bsolute short-name path of the software composition.

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

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen,,,,where姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:“ Model Periodicrunnables”,“ AtomicSubsystem”指示进口商将AutoSar周期性运行可运行型建模为具有周期性速率的原子子系统。

创建构图的模拟表示时,现有的原子软件组件模型的名称。万博1manbetx该函数将指定的现有组件模型包含在组成模型中,而不是创建新的组件模型。

Example:'componentModels',{'myswc1','myswc2'}

万博1manbetxSimulink Data词典将其导入与XML文件中的AutoSar数据类型相对应的数据对象。如果指定的词典尚未存在,则进口商会创建它。然后,该模型与该数据字典关联。

If you specifytruefor the“ ShareAutoSarproperties”参数,指定的数据字典还存储可共享的autosar属性,例如接口和数据类型,以在组成中的组件之间共享。

Example:'Datadictionary',,,,'ardata.sldd'

By default,createCompositionasmodel导入AutoSar周期性运行中的可运行物,并试图将其作为定期率的原子子系统建模。如果条件阻止使用原子子系统,则该函数将周期性运行式运行式函数作为函数通用子系统,并具有周期性速率。

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

要模拟周期性可运行物作为函数通行子系统,请指定'FunctionCallSubsystem'

For more information, seeImport AUTOSAR Software Component with Multiple Runnables

Example:“ Model Periodicrunnables”,“ AtomicSubsystem”

Path to aPredefinedVariantdefined in the AUTOSAR XML file. APredefinedVariantdescribes a combination of system constant values among potentially multiple valid combinations to apply to AUTOSAR software components. Use this argument to resolve variation points in AUTOSAR software components at model creation time. If specified, the importer uses thePredefinedVariantto initializeSwSystemconstdata that serves as input to control variation points.

For more information, seeControl AUTOSAR Variants with Predefined Value Combinations

Example:“预定变量”,,,,'/pkg/身体/变体/高级'

To improve the performance of common tasks in AUTOSAR composition modeling, composition import can store sharable component properties, such as interfaces and data types, into a Simulink data dictionary. Components within the composition can then share the stored properties.

For compositions containing more than 20 software components, sharing AUTOSAR properties among components can significantly improve performance for composition workflows, including import, dictionary navigation, AUTOSAR validation, and code generation. Limiting property replication among components can reduce component model file sizes.

这shared AUTOSAR dictionary provides a central location for viewing and configuring AUTOSAR composition and component properties. You can view read-only properties, such as shared component interfaces, and modify XML options for composition and component export.

To share AUTOSAR properties, specifytrue。For each imported component, the function stores sharable AUTOSAR properties, such as interfaces and data types, in the Simulink data dictionary specified by the'Datadictionary'争论。这'Datadictionary'必须指定参数。

For more information, see导入汽车组合and Share AUTOSAR Dictionary

Example:“ ShareAutoSarproperties”,真实

Paths to one or moreSystemConstValueSets在AutoSar XML文件中定义。一个SystemConstValueSetspecifies a set of system constant values to apply to AUTOSAR software components. Use this argument to resolve variation points in AUTOSAR software components at model creation time. If specified, the importer uses theSystemConstValueSets初始化SwSystemconstdata that serves as input to control variation points.

For more information, seeControl AUTOSAR Variants with Predefined Value Combinations

Example:'SystemConstvaluesets','{'/pkg/body/systemConstantValues/a','/pkg/body/system constantvalues/b'}'}'

输出参数

collapse all

将句柄返回创建模型的变量。

如果导入成功,则返回true的变量。否则,返回false。

小费s

如果您输入arxml.importer目的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 tocreateCompositionasmodelandCreateComponentAsmodel

版本历史记录

在R2017b中引入