- get ECU description object - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.html
- add - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.add.html
- find - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.find.html
- set - https://www.mathworks.com/help/rtw/ref/coder.asap2.getecudescriptions.set.html
- export - https://www.mathworks.com/help/rtw/ref/coder.asap2.export.html
How to get unit into A2L for a signal?
조회 수: 11 (최근 30일)
이전 댓글 표시
Hi,
I have a question regarding how a signal UNIT should be outputted into the A2L file when the code is generated for a AUTOSAR complaint model.
How could I set so my signals get a specific conversion method of my signal. In this example I want to get degC as a Unit of my signal via a COMPU_METHOD declaration in the A2L.
Ex:
/begin MEASUREMENT
/* Name */ NewSigInDegrees
/* Long identifier */ "My information about NewSig"
/* Data type */ FLOAT32_IEEE
/* Conversion method */ CM_degC
/* Resolution (Not used) */ 0
/* Accuracy (Not used) */ 0
/* Lower limit */ -100
/* Upper limit */ 2000
ECU_ADDRESS 0x0000 /* @ECU_Address@NewSigInDegrees@ */
/end MEASUREMENT
/begin COMPU_METHOD
CM_degC /* Name */
"" /* LongIdentifier */
RAT_FUNC /* ConversionType */
"%12.6" /* Format */
"deg C" /* Unit */
COEFFS 0 1 0 0 0 1
/end COMPU_METHOD
Best Regards
댓글 수: 0
답변 (1개)
Paras Gupta
2024년 6월 20일
Hi Ulf,
I understand that you're looking to ensure that your signals are represented with a different unit via COMPU_METHOD declaration in an A2L file for an AUTOSAR-compliant model in MATLAB R2019b.
Note that MATLAB R2019b does not provide the option to create a custom definition of 'CompuMethod' and associate that with a measurement/characteristic.
However, as of MATLAB R2022b, you can use the 'coder.asap2.getEcuDescriptions' object to create an information object for your model ans customize it by creating a new 'CompuMethod' and setting it for your desired signals. Please refer to the "Customize an ASAP2 File" example given in the following documentation for more information on the same:
The following links can be useful to learn more about ASAP2 Customization:
Hope this helps.
댓글 수: 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!