Why is the "createComponentAsModel" function generating a model with incorrect data types in MATLAB R2018b?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 26 Okt. 2022
Bearbeitet: MathWorks Support Team
am 29 Aug. 2024
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:
Akzeptierte Antwort
MathWorks Support Team
am 29 Jul. 2024
Bearbeitet: MathWorks Support Team
am 29 Aug. 2024
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu AUTOSAR Blockset finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!