createCompositionasmodel
Create万博1manbetxrepresentation of AUTOSAR ARXML software composition
句法
Description
createCompositionSmodel(
创建一个模拟万博1manbetx®对应于Autosar软件组成的型号ar
,,,,构图名
)构图名
。这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。
Examples
导入汽车组合
Import AUTOSAR software composition/Company/Components/ThrottlePositionControlComposition
from the fileThrottlePositionControlComposition.arxml
。这一个RXML file is located at
,在默认MATLAB上®path. Create an initial Simulink representation of the composition.matlabroot
/examples/autosarblockset/data
ar = arxml.importer('thorottlePositionControlComposition.arxml'); names = getComponentNames(ar,'作品')
names = 1×1 cell array {'/Company/Components/ThrottlePositionControlComposition'}
createCompositionSmodel(ar,'/company/组件/throttlePositionControlComposition');
导入Autosar组成并包括现有组件模型
Import AUTOSAR software composition/pkg/rootComposition
from XML filemySWCs.arxml
并创建组合物的初始模拟表示。万博1manbetxFor componentsmySwc1
andmySwc2
包含在构图中,使用现有的Simulink组件模型,而不是创建新的模型。万博1manbetx
ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,“ componentModels”,,,,{'myswc1',,,,'myswc2'})
导入汽车组成和使用Data Dictionary
Import AUTOSAR software composition/pkg/rootComposition
from XML filemySWCs.arxml
并创建组合物的初始模拟表示。万博1manbetx将与Auto万博1manbetxSar数据类型相对应的Simulink数据对象放入数据字典中ardata.sldd
。
ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,'Datadictionary',,,,'ardata.sldd')
导入汽车组合and Share AUTOSAR Dictionary
Import AUTOSAR software composition/Company/Components/ThrottlePositionControlComposition
from the fileThrottlePositionControlComposition.arxml
。这一个RXML file is located at
,在默认MATLAB上path. Create an initial Simulink representation of the composition.matlabroot
/examples/autosarblockset/data
对于每个导入的组件,进口商在数据字典中存储可共享的汽车属性,例如接口和数据类型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”)
导入Autosar组成和模型周期性运行物作为功能通话子系统
Import AUTOSAR software composition/pkg/rootComposition
from XML filemySWCs.arxml
并创建组合物的初始模拟表示。万博1manbetx模型AutoSar周期可运行物作为具有周期性速率的功能通用子系统。
ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,...'ModelPeriodicRunnablesAs',,,,'FunctionCallSubsystem')
导入汽车组成和使用PredefinedVariant
解决变化点
Import AUTOSAR software composition/pkg/rootComposition
from XML filemySWCs.arxml
并创建组合物的初始模拟表示。万博1manbetxUsePredefinedVariant
Senior to resolve variation points in components at model creation time.
ar = arxml.importer('mySWCs.arxml')createCompositionSmodel(ar,'/pkg/rootcomposition',,,,...“预定变量”,,,,'/pkg/身体/变体/高级');
导入汽车组成和使用SwSystemconstantValueSet
s to Resolve Variation Points
Import AUTOSAR software composition/pkg/rootComposition
from XML filemySWCs.arxml
并创建组合物的初始模拟表示。万博1manbetxUseSwSystemconstantValueSet
s 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
ar
-arxml.importer
目的
handle
一个UTOSAR information previously imported from XML files, specified as anarxml.importer
对象句柄。
构图名
-组成路径
character vector|字符串标量
一个bsolute short-name path of the software composition.
Example:'/Company/Powertrain/Components/RootComposition'
名称值参数
Specify optional pairs of arguments asname1 = value1,...,namen = valuen
,,,,where姓名
是参数名称和Value
is 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周期性运行可运行型建模为具有周期性速率的原子子系统。
组件模型
-Simulink component models
字符向量的单元格数|string array
创建构图的模拟表示时,现有的原子软件组件模型的名称。万博1manbetx该函数将指定的现有组件模型包含在组成模型中,而不是创建新的组件模型。
Example:'componentModels',{'myswc1','myswc2'}
DataDictionary
-万博1manbetxSimulink数据词典
character vector|字符串标量
万博1manbetxSimulink Data词典将其导入与XML文件中的AutoSar数据类型相对应的数据对象。如果指定的词典尚未存在,则进口商会创建它。然后,该模型与该数据字典关联。
If you specifytrue
for the“ ShareAutoSarproperties”
参数,指定的数据字典还存储可共享的autosar属性,例如接口和数据类型,以在组成中的组件之间共享。
Example:'Datadictionary',,,,'ardata.sldd'
ModelPeriodicRunnablesAs
-Subsystem type for periodic runnables
'汽车'
(默认)|“ AtomicSubsystem”
|'FunctionCallSubsystem'
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”
PredefinedVariant
-Path to AUTOSAR predefined variant
character vector|字符串标量
Path to aPredefinedVariant
defined in the AUTOSAR XML file. APredefinedVariant
describes 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 thePredefinedVariant
to initializeSwSystemconst
data that serves as input to control variation points.
For more information, seeControl AUTOSAR Variants with Predefined Value Combinations。
Example:“预定变量”,,,,'/pkg/身体/变体/高级'
ShareAutoSarproperties
-将AutoSar组件属性添加到共享字典中
错误的
(默认)|true
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”,真实
SystemConstValueSets
-Paths to one or more AUTOSAR system constant value sets
字符向量的单元格数|string array
Paths to one or moreSystemConstValueSet
s在AutoSar XML文件中定义。一个SystemConstValueSet
specifies 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 theSystemConstValueSet
s初始化SwSystemconst
data 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'}'}'
输出参数
mdl
-Model handle
handle
将句柄返回创建模型的变量。
sts
-Success or failure
对或错
如果导入成功,则返回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 tocreateCompositionasmodel
andCreateComponentAsmodel
。
版本历史记录
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
一个mericas
- 一个mérica Latina(Español)
- Canada(English)
- United States(English)