필터 지우기
필터 지우기

Exclude 'MEASUREMENT' signals from A2L for AUTOSAR model

조회 수: 7 (최근 30일)
Shardul Kulkarni
Shardul Kulkarni 2024년 6월 3일
답변: Paras Gupta 2024년 6월 18일
I'm trying to generate A2L file for an AUTOSAR model using API, 'coder.asap2.export'. Unlike the A2L file generated during build, A2L generated with this method is having 'MEASUREMENT' signals for IOs.
Is there any way to generate A2L for AUTOSAR model, without 'MEASUREMENT' signals?

답변 (1개)

Paras Gupta
Paras Gupta 2024년 6월 18일
Hi Shardul,
In order to generate an A2L file for an AUTOSAR model without the 'MEASUREMENT' signals', you can refer to the following code snippet:
% Open the specified Simulink model
open_system(model);
% Build the Simulink model, suppressing output with evalc
evalc('slbuild(model)');
% Get the ECU (Electronic Control Unit) descriptions from the model
desc = coder.asap2.getEcuDescriptions(model);
% Find all measurement objects within the ECU descriptions
measurements = desc.find('Measurement');
% Loop through each measurement object to set its 'Export' property to false
for idx = 1:length(measurements)
set(desc, measurements(idx) , 'Export', false);
end
% Export the modified ECU descriptions to a file named "CustomEcuDescriptions"
coder.asap2.export(model, "CustomEcuDescriptions",desc);
Please refer to the below documentations links for more information on the functions used above:
Hope this helps.

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by