このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
coder.asap2.Group
説明
Create a group object to view characteristics and measurements together and export it to an ASAP2 file.
作成
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
プロパティ
Specify a name for the custom group.
例: "CustomGroup_1"
Specify comments and description of the group.
例: "Description of the group"
Specify the list of parameters referred in the group.
例: ["Parameter1", "Parameter2"]
Specify the list of signals referred in the group.
例: ["Signal1", "Signal2"]
Specifies the root of the group's hierarchy.
例: 1
Specify the list of sub groups referred in the group.
例: ["Subgroup1", "Subgroup2"]
Specify any additional description that needs to be populated in the group.
例: "additional information"
例
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 ### 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 7.3874s Top model targets: Model Build Reason Status Build Duration ============================================================================================================ ASAP2Demo Information cache folder or artifacts were missing. Code generated and compiled. 0h 0m 13.761s 2 of 2 models built (0 models already up to date) Build duration: 0h 0m 22.418s
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");
バージョン履歴
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)