coder.asap2.Group
Description
Create a group object to view characteristics and measurements together and export it to an ASAP2 file.
Creation
creates a group
object. You can use the object to define list of characteristic, measurements, subgroups to
the group and export it to an ASAP2 file.groupObj
= coder.asap2.Group
Properties
Specify a name for the custom group.
Example:
"CustomGroup_1"
Specify comments and description of the group.
Example:
"Description of the group"
Specify the list of parameters referred in the group.
Example:
["Parameter1", "Parameter2"]
Specify the list of signals referred in the group.
Example:
["Signal1", "Signal2"]
Specifies the root of the group's hierarchy.
Example:
1
Specify the list of sub groups referred in the group.
Example:
["Subgroup1", "Subgroup2"]
Specify any additional description that needs to be populated in the group.
Example:
"additional information"
Examples
Add, update, filter, find, and remove ECU descriptions for groups in an ASAP2 file.
Open and Build Example Model
Open the example model ASAP2Demo
open_system("ASAP2Demo");
Build the model.
slbuild("ASAP2Demo");
### Searching for referenced models in model 'ASAP2Demo'. ### Total of 2 models to build. ### Starting serial code generation build. ### Successfully updated the model reference code generation target for: ASAP2DemoModelRef ### Starting build procedure for: ASAP2Demo codeInterfacePackaging: Nonreusable function codeInterfacePackaging: NonReusable ### Successful completion of build procedure for: ASAP2Demo Build Summary Model reference code generation targets: Model Build Reason Status Build Duration ============================================================================================================ ASAP2DemoModelRef Target (ASAP2DemoModelRef.c) did not exist. Code generated and compiled. 0h 0m 11.266s Top model targets: Model Build Reason Status Build Duration ============================================================================================================ ASAP2Demo Information cache folder or artifacts were missing. Code generated and compiled. 0h 0m 21.379s 2 of 2 models built (0 models already up to date) Build duration: 0h 0m 34.156s
Create the ECU description object for the model.
descObj = coder.asap2.getEcuDescriptions("ASAP2Demo");
Get the list of available groups in the description object.
find(descObj,"Group")
ans = 1×2 string
"ASAP2Demo" "ASAP2Demo.ASAP2DemoModelRef.ASAP2DemoModelRef"
Filter the groups and get a list of groups that has Root
set to true
.
find(descObj,"Group",Root=true)
ans = "ASAP2Demo"
Create and Add Custom Group
To add a new group to the ASAP2 file, create a custom group.
GroupObj_GR1 = coder.asap2.Group; GroupObj_GR1.Name = 'CustomGroup_1'; GroupObj_GR1.LongIdentifier = 'New test group'; GroupObj_GR1.RefCharacteristic = ["ydata3", "ydata4"]; GroupObj_GR1.RefMeasurement = ["ASAP2Demo_Y.Out3", "ASAP2Demo_Y.Out3"]; GroupObj_GR1.Root = true;
Add the custom group to the ECU description object.
add(descObj,GroupObj_GR1);
Get Group Properties
Get the properties of newly added group by using this command.
get(descObj,"Group","CustomGroup_1")
ans = Group with properties: Name: 'CustomGroup_1' LongIdentifier: 'New test group' RefCharacteristic: ["ydata3" "ydata4"] RefMeasurement: ["ASAP2Demo_Y.Out3" "ASAP2Demo_Y.Out3"] Root: 1 SubGroup: [1×0 string] CustomData: [1×0 string]
Update Group Properties
To modify a property of the group, use set function. Update the LongIdentifier field of the group.
set(descObj,"Group","CustomGroup_1",LongIdentifier="Group 1 new long identifier")
Generate the ASAP2 file using the updated ECU description object and verify that the ASAP2 file contains the group CustomGroup_1.
coder.asap2.export("ASAP2Demo",CustomEcuDescriptions=descObj);
Following Characteristics or Measurements with unsupported data types are not exported in ASAP2 file. "ASAP2Demo_DW.ASAP2DemoModelRef_InstanceData"
Delete Group
Remove the newly added group from the description object.
delete(descObj,"Group","CustomGroup_1");
Version History
Introduced in R2023b
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)