How to enable BitMask in EcuDescriptions when using coder.asap2.export
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Ashutosh Thakur
2024 年 7 月 17 日
Hi Mukesh,
Can you share your model and a2l file so that I can check on my end?
Thanks
回答 (1 件)
Ashutosh Thakur
2024 年 7 月 17 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!