- coder.asap2.getEcuDescriptions は、A2Lファイルに出力するECU(電子制御ユニット)記述情報をカスタマイズするための関数です。
- Measurement以外にも、Characteristicなども同様の方法で除外可能です。
- 詳細なカスタマイズ手順については、以下の公式ドキュメントをご参照ください。
Simulink の coder.asap2.export で A2L ファイルへ特定のデータを出力しない方法はありますか?
7 views (last 30 days)
Show older comments
MathWorks Support Team
on 16 Jul 2025
Answered: MathWorks Support Team
on 16 Jul 2025
A2Lファイルをエクスポートする際に、特定のデータのみを除外する方法を知りたいです。どのように設定すれば、指定したデータをA2Lファイルに出力しないようにできますか?
Accepted Answer
MathWorks Support Team
on 16 Jul 2025
A2Lファイルのエクスポート時に特定のデータを除外したい場合、そのデータの「Export」フラグを false(出力しない)に設定する方法があります。
【手順例】
以下は、名前に「_a_Sig_」を含むMeasurement(計測用変数)をA2Lファイルから除外するサンプルスクリプトです。
descObj = coder.asap2.getEcuDescriptions(bdroot); % モデルのECU記述オブジェクトを取得
measurements = descObj.find('Measurement'); % 全Measurementを取得
for measurement = measurements
if contains(measurement,'_a_Sig_') % 名称に"_a_Sig_"が含まれるか判定
set(descObj,'Measurement',measurement,Export = false); % Exportフラグをfalseに
end
end
coder.asap2.export(bdroot,CustomEcuDescriptions=descObj) % 設定を反映してA2Lをエクスポート
【補足】
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!