- evalc - https://www.mathworks.com/help/matlab/ref/evalc.html
- coder.asap2.getEcuDescriptions - https://www.mathworks.com/help/ecoder/ref/coder.asap2.getecudescriptions.html
- find - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.find.html
- set - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.set.html
- coder.asap2.export - https://www.mathworks.com/help/ecoder/ref/coder.asap2.export.html
Exclude 'MEASUREMENT' signals from A2L for AUTOSAR model
3 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Paras Gupta
on 18 Jun 2024
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.
0 Comments
See Also
Categories
Find more on AUTOSAR Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!