Borrar filtros
Borrar filtros

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

24 visualizaciones (últimos 30 días)
Mukesh Agarwal
Mukesh Agarwal el 16 de Jul. de 2024 a las 14:59
Respondida: Ashutosh Thakur el 17 de Jul. de 2024 a las 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 comentario
Ashutosh Thakur
Ashutosh Thakur el 17 de Jul. de 2024 a las 9:52
Hi Mukesh,
Can you share your model and a2l file so that I can check on my end?
Thanks

Iniciar sesión para comentar.

Respuestas (1)

Ashutosh Thakur
Ashutosh Thakur el 17 de Jul. de 2024 a las 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!

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by