How to enable BitMask in EcuDescriptions when using coder.asap2.export

5 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Ashutosh Thakur
Ashutosh Thakur il 17 Lug 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:
% 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!

Categorie

Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by