Why is the "createComponentAsModel" function generating a model with incorrect data types in MATLAB R2018b?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 26 Oct 2022
Modifié(e) : MathWorks Support Team
le 29 Août 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:
Réponse acceptée
MathWorks Support Team
le 29 Juil 2024
Modifié(e) : MathWorks Support Team
le 29 Août 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur AUTOSAR Blockset dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!