Why is the "createComponentAsModel" function generating a model with incorrect data types in MATLAB R2018b?
9 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2022-10-26
编辑: MathWorks Support Team
2024-8-29
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
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 AUTOSAR Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!