How to enable BitMask in EcuDescriptions when using coder.asap2.export
4 views (last 30 days)
Show older comments
I have created CSC for measurement signals and I am packing my signals as bitfield. My generated code has all signals declared inside a structure with bitwidth. when I use coder.asap2.export to generate a2l file, Measurement has no BitMAsk Information.
With Matlab 2023b, I tried to extract EcuDescriptions using command descObj = coder.asap2.getEcuDescriptions("ModelName") and then I tried to extract measurement properties using command get(descObj,"Measurement","Struct.Signal1"). Measurement object has no information on BitMask.
Can someone guide me how to configure my model so that BitMAsk information is present in my a2l file?
1 Comment
Ashutosh Thakur
on 17 Jul 2024
Hi Mukesh,
Can you share your model and a2l file so that I can check on my end?
Thanks
Answers (1)
Ashutosh Thakur
on 17 Jul 2024
Hello Mukesh,
In order to configure the model to include BitMask information in the A2L file, you can use the set function to set the property of the specified category. This function will be used to modify the EcuDescriptions, and the modified EcuDescription will then be passed to the coder.asap2.export function to generate the A2L file.
This process can be understood with the following sample code:
% getting the EcuDescriptions
descObj = coder.asap2.getEcuDescriptions("ModelName")
% setting the BitMask property of descObj
set(descObj,"Measurement","Struct.Signal1","BitMask","0x0A")
You can refer to the following documentation on usage of set function:
- https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.set.html
- https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.html
% getting the measurement object to see if BitMask property is updated or not
get(descObj,"Measurement","Struct.Signal1")
% Now we will pass this custom EcuDescription to the coder.asap2.export
% function
coder.asap2.export("ModelName",CustomEcuDescriptions=descObj);
You can refer to the following link on understanding functionalities of coder.asap2.export function:
I hope this helps you in generating BitMask property in A2L file!
0 Comments
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware 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!