このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
coder.asap2.getEcuDescriptions
説明
ECU 説明オブジェクトおよびその関数を使用すれば、ASAP2 ファイルの ECU の説明の追加、削除、検索、フィルター処理、更新、および取得を行うことができます。関数を使用してモデルの情報オブジェクトを作成できます。
作成
は、モデル descObj
= coder.asap2.getEcuDescriptions(modelName
)modelName
用に descObj
という名前の ECU 説明オブジェクトを作成します。
プロパティ
Folder
— A2L ファイルをエクスポートするフォルダーの場所
文字ベクトル | string スカラー
エクスポートされた A2L ファイルを配置するフォルダーへの絶対パス。
例: Folder='/home/temp/prjct/'
FileName
— エクスポートした A2L ファイルのカスタム名
文字ベクトル | string スカラー
エクスポートした A2L ファイルの名前。
例: FileName='test_car'
MapFile
— モデルのシンボル ファイルの名前
ELF | PDB | DWARF | 実行可能ファイル
生成コードのシンボルを含むモデルのシンボル ファイルの名前。たとえば、生成コードで使用される変数のアドレスです。
例: MapFile='model.elf'
Version
— A2L ファイルのバージョン
1.71 (既定値) | 1.31 | 1.61
ASAM で定義された ASAM MCD-2 MC 標準に基づく A2L ファイル形式。ASAM MCD-2 MC 標準には複数のバージョンがあります。必要な A2L のバージョンを指定します。
例: Version='1.61'
または Version='1.31'
Comments
— A2L ファイルにコメントを含める
true (既定値) | false
コメントを含めるか除外して A2L ファイルを生成します。
例: Comments=true
GenerateXCPInfo
— A2L ファイルに A2ML および IF_DATA を含める
true (既定値) | false
A2ML および IF_DATA セクションを含めるか除外して A2L ファイルを生成します。
例: GenerateXCPInfo=true
ModelClassInstanceName
— クラス インスタンス名とパス名の指定
文字ベクトル | string スカラー
A2L ファイルのカスタム モデルのインスタンス名。この引数は AUTOSAR Adaptive モデルにのみ適用されます。
例: ModelClassInstanceName='customObj'
または ModelClassInstanceName='customNameSpace::customObj'
IndentFile
— A2L ファイルのインデントに従います。
false (既定値) | true
インデントに従って A2L ファイルを生成します。
例: IndentFile=true
CustomizationObject
— ASAP2 フィールドのカスタマイズ
coder.asap2.UserCustomizeBase
オブジェクト (既定値)
ユーザー ベースを作成して、次のような ASAP2 フィールドをカスタマイズします。
ASAP2FileName
ByteOrder
HeaderComment
ModParComment
ModCommonComment
例: CustomizationObject=obj
CustomizeGroupsBy
— ASAP2 ファイルのグループのカスタマイズ
ARRAY
| SCALAR
| MAP
| CUBOID
| CURVE
| CUBE_4
| CUBE_5
パラメーターと信号をそのプロパティに基づいてグループ化します。
例: CustomizeGroupsBy={'ARRAY','MAP'}
IncludeAllRecordLayouts
— 基本データ型のレコード レイアウトのエクスポート
false (既定値) | true
A2L ファイルのバージョンに従って、すべての基本データ型のレコード レイアウトを RecordLayouts.a2l
という名前のファイルにエクスポートします。
例: IncludeAllRecordLayouts=true
SupportStructureElements
— ASAP2 ファイルに構造体要素を含めるまたは除外する
true (既定値) | false
生成された ASAP2 ファイルで構造体の一部である要素を除外するには false
を指定します。
例: SupportStructureElements=false
Support64bitIntegers
— ASAP2 ファイルに 64 ビット整数を含めるまたは除外する
true (既定値) | false
生成された ASAP2 ファイルで 64 ビット整数を除外するには false
を指定します。
例: Support64bitIntegers=false
EcuAddressExtension
— 追加のアドレス情報の指定
int
ASAP2 ファイルで追加のアドレス情報を指定するには 32 ビット整数値を指定します。既定では、追加のアドレス情報は必要ありません。
例: EcuAddressExtension=4
IncludeAutosarRteElements
— RTE 要素のエクスポート
true (既定値) | false
AUTOSAR RTE 要素を含めるか除外して A2L ファイルを生成します。
メモ
このオプションは AUTOSAR Classic モデルにのみ適用されます。
例: IncludeAutosarRteElements=true
UseSavedSettings
— 基本設定の保存と使用
false (既定値) | true
基本設定を保存し、更新後の基本設定を使用して ASAP2 ファイルを生成します。たとえば、コメントや ASAP2 ファイルのバージョンなどを含めて生成します。
例: UseSavedSettings=false
IncludeDefaultEventList
— 既定のイベントの作成
true (既定値) | false
A2L ファイルに既定のイベントのリストを含めるには true を指定します。
例: IncludeDefaultEventList=true
ToggleArrayLayout
— 配列のレイアウトの変更
false (既定値) | true
配列のレイアウトを ROW_DIR
または COL_DIR
に更新して、配列データを行方向または列方向に表示します。
例: ToggleArrayLayout=true
IncludeSharedElements
— Compu Method とレコード レイアウトの個別のエクスポート
true (既定値) | false
Compu Method とレコード レイアウト用の個別の A2L ファイルを生成します。
メモ
このオプションは ERT ベースのシステム ターゲット ファイルをもつモデルにのみ適用されます。
例: IncludeSharedElements=true
オブジェクト関数
例
ASAP2 ファイルのカスタマイズ
ASAP2 ファイルで ECU の説明の追加、更新、フィルター処理、検索、および削除を行います。
モデル例を開いて作成
モデル例 "ASAP2Demo" を開きます。
open_system("ASAP2Demo");
モデルをビルドします。
rtwbuild("ASAP2Demo");
### Starting serial model reference 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 Code generation targets built: Model Action Rebuild Reason ====================================================================================== ASAP2DemoModelRef Code generated and compiled. ASAP2DemoModelRef.c does not exist. Top model targets built: Model Action Rebuild Reason =========================================================================================== ASAP2Demo Code generated and compiled. Code generation information file does not exist. 2 of 2 models built (0 models already up to date) Build duration: 0h 0m 23.446s
モデルの ECU 説明オブジェクトを作成します。
descObj = coder.asap2.getEcuDescriptions("ASAP2Demo");
説明オブジェクトで使用可能な計算方法のリストを取得します。
find(descObj,"CompuMethod")
ans = 1x10 string
"ASAP2DemoModelRef_CM_double" "ASAP2DemoModelRef_CM_int16_rpm" "ASAP2Demo_CM_double" "ASAP2Demo_CM_double_m_per__s_2_" "ASAP2Demo_CM_double_rpm" "ASAP2Demo_CM_int32" "ASAP2Demo_CM_single" "ASAP2Demo_CM_single_m_per__s_2_" "ASAP2Demo_CM_single_rpm" "ASAP2Demo_CM_uint8"
計算方法を絞り込み、単位として "rpm" を使用する計算方法のリストを取得します。
find(descObj,"CompuMethod",Units='rpm')
ans = 1x3 string
"ASAP2DemoModelRef_CM_int16_rpm" "ASAP2Demo_CM_double_rpm" "ASAP2Demo_CM_single_rpm"
カスタム計算方法の作成と追加
ASAP2 ファイルに新しい計算方法を追加するには、カスタム計算方法を作成します。
CompuMethod_CM1 = coder.asap2.CompuMethod; CompuMethod_CM1.Name = 'CompuMethod_1'; CompuMethod_CM1.ConversionType = 'LINEAR'; CompuMethod_CM1.Coefficients = [2 3]; CompuMethod_CM1.LongIdentifier = 'longIdentifierTest'; CompuMethod_CM1.Format = '%2.3'; CompuMethod_CM1.Units = 's';
ECU 説明オブジェクトにカスタム計算方法を追加します。
add(descObj,CompuMethod_CM1);
新規に追加された計算方法のプロパティを取得します。
get(descObj,"CompuMethod","CompuMethod_1")
ans = CompuMethod with properties: Name: 'CompuMethod_1' LongIdentifier: 'longIdentifierTest' Format: '%2.3' Units: 's' Coefficients: [2 3] ConversionType: 'LINEAR' CompuVTabValues: [1x1 struct] CustomData: ""
計算方法のプロパティを変更するには、関数 "set" を使用します。計算方法の "LongIdentifier" フィールドを更新します。
set(descObj,"CompuMethod","CompuMethod_1",LongIdentifier="longIdentifierCM1")
更新した ECU 説明オブジェクトを使用して ASAP2 ファイルを生成し、ASAP2 ファイルに計算方法 "CompuMethod_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(descObj,"CompuMethod","CompuMethod_1");
カスタム特性の作成と追加
ASAP2 ファイルに新しい特性を追加するには、カスタム特性を作成します。
Parameter_1 = coder.asap2.Characteristic; Parameter_1.Name = 'Custom_parameter1'; Parameter_1.LongIdentifier = 'longIdentifierParam'; Parameter_1.UpperLimit = 255; Parameter_1.LowerLimit = 0;
カスタム特性を ECU 説明オブジェクトに追加します。
add(descObj,Parameter_1);
新規に追加された特性のプロパティを取得します。
get(descObj,"Characteristic","Custom_parameter1")
ans = Characteristic with properties: Name: 'Custom_parameter1' LongIdentifier: 'longIdentifierParam' Type: 'VALUE' EcuAddress: '0x0000' CompuMethodName: 'NO_COMPU_METHOD' LowerLimit: 0 UpperLimit: 255 EcuAddressComment: "" EcuAddressExtension: [] CalibrationAccess: 'Calibration' DisplayIdentifier: "" Format: "" BitMask: [] AxisInfo: [] RecordLayout: "" Dimensions: [] Export: 1 MaxRefresh: [1x1 struct] SymbolLink: [1x1 struct] CustomData: ""
特性のプロパティを変更するには、関数 "set" を使用します。特性の "UpperLimit" フィールドを更新します。
set(descObj,"Characteristic","Custom_parameter1",UpperLimit=128)
更新した ECU 説明オブジェクトを使用して ASAP2 ファイルを生成し、ASAP2 ファイルに特性 "Custom_parameter1" が含まれていることを確認します。
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(descObj,"Characteristic","Custom_parameter1");
カスタム測定の作成と追加
ASAP2 ファイルに新しい測定を追加するには、カスタム測定を作成します。
Signal_1 = coder.asap2.Measurement; Signal_1.Name = 'Custom_signal1'; Signal_1.LongIdentifier = 'longIdentifierSignal'; Signal_1.UpperLimit = 255; Signal_1.LowerLimit = 0;
カスタム測定を ECU 説明オブジェクトに追加します。
add(descObj,Signal_1);
新規に追加された測定のプロパティを取得します。
get(descObj,"Measurement","Custom_signal1")
ans = Measurement with properties: Name: 'Custom_signal1' LongIdentifier: 'longIdentifierSignal' DataType: 'UBYTE' EcuAddress: '0x0000' CompuMethodName: "" LowerLimit: 0 UpperLimit: 255 Raster: [1x1 struct] EcuAddressComment: "" EcuAddressExtension: [] CalibrationAccess: 'NoCalibration' DisplayIdentifier: "" Format: "" BitMask: [] Dimensions: [] Export: 1 MaskData: [1x1 struct] MaxRefresh: [1x1 struct] SymbolLink: [1x1 struct] CustomData: ""
測定のプロパティを変更するには、関数 "set" を使用します。測定の "CalibrationAccess" フィールドを更新します。
set(descObj,"Measurement","Custom_signal1",CalibrationAccess='Calibration')
更新した ECU 説明オブジェクトを使用して ASAP2 ファイルを生成し、ASAP2 ファイルに "Custom_signal1" という名前の測定が含まれていることを確認します。
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(descObj,"Measurement","Custom_signal1");
ルックアップ テーブル パラメーターの作成と追加
ルックアップ テーブル パラメーターを追加します。
LUT_Parameter = coder.asap2.Characteristic; LUT_Parameter.Name = "custom_lookup_table"; LUT_Parameter.Type = "MAP";
軸情報を作成してパラメーターに追加します。
axis_data = coder.asap2.AxisInfo; axis_data(1).Name = 'BP3'; axis_data(2).Name = 'Bp4'; axis_data(1).CompuMethodName = 'ASAP2Demo_CM_double'; axis_data(2).CompuMethodName = 'ASAP2Demo_CM_double'; axis_data(1).MaxAxisPoints = '3'; axis_data(2).MaxAxisPoints = '3'; axis_data(1).AxisType = 'STD_AXIS'; axis_data(2).AxisType = 'STD_AXIS'; LUT_Parameter.AxisInfo = axis_data;
ルックアップ テーブル パラメーターを説明オブジェクトに追加します。
add(descObj,LUT_Parameter)
更新した ECU 説明オブジェクトを使用して ASAP2 ファイルを生成し、ASAP2 ファイルにルックアップ テーブル パラメーター "custom_lookup_table" が含まれていることを確認します。
coder.asap2.export("ASAP2Demo",CustomEcuDescriptions=descObj);
Following Characteristics or Measurements with unsupported data types are not exported in ASAP2 file. "ASAP2Demo_DW.ASAP2DemoModelRef_InstanceData"
バージョン履歴
R2022b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)