Why is the "createComponentAsModel" function generating a model with incorrect data types in MATLAB R2018b?

조회 수: 9 (최근 30일)
I am trying to use the "createComponentAsModel" function to generate an AUTOSAR MBD Model from my custom ARXML file.
Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation of the function:
>> web(fullfile(docroot, 'autosar/ref/arxml.importer.createcomponentasmodel.html'))
The issue that I encountered is that the generated model contains different datatype definitions compared to the datatypes I defined in the ARXML file
For example, if I were to define a "float32" type in the ARXML file, the generated model would have a "uint32" type instead.
Is this a bug with the function?
Please follow the below link to search for the required information regarding the current release:

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 7월 29일
편집: MathWorks Support Team 2024년 8월 29일
According to the AUTOSAR specification for platform types, "float32", and "float" should follow IEEE754 encoding.
The encoding type for "float32" has been set to "NONE" in your ARXML file which is why the generated model has an incorrect datatype.
<SW-BASE-TYPE UUID="BB616C701EE7">
<SHORT-NAME>float32</SHORT-NAME>
<CATEGORY>FIXED_LENGTH</CATEGORY>
<BASE-TYPE-SIZE>32</BASE-TYPE-SIZE>
<BASE-TYPE-ENCODING>NONE</BASE-TYPE-ENCODING>
<NATIVE-DECLARATION>float</NATIVE-DECLARATION>
</SW-BASE-TYPE>
The issue will be resolved once you set the "BASE_ENCODING_TYPE" to IEEE754 as shown below.
<SW-BASE-TYPE UUID="BB616C701EE7">
<SHORT-NAME>float32</SHORT-NAME>
<CATEGORY>FIXED_LENGTH</CATEGORY>
<BASE-TYPE-SIZE>32</BASE-TYPE-SIZE>
<BASE-TYPE-ENCODING>IEEE754</BASE-TYPE-ENCODING>
<NATIVE-DECLARATION>float</NATIVE-DECLARATION>
</SW-BASE-TYPE>

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by