Effacer les filtres
Effacer les filtres

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

24 vues (au cours des 30 derniers jours)
Mukesh Agarwal
Mukesh Agarwal le 16 Juil 2024 à 14:59
Réponse apportée : Ashutosh Thakur le 17 Juil 2024 à 11:06
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 commentaire
Ashutosh Thakur
Ashutosh Thakur le 17 Juil 2024 à 9:52
Hi Mukesh,
Can you share your model and a2l file so that I can check on my end?
Thanks

Connectez-vous pour commenter.

Réponses (1)

Ashutosh Thakur
Ashutosh Thakur le 17 Juil 2024 à 11:06
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!

Catégories

En savoir plus sur Deployment, Integration, and Supported Hardware dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by