Type mismatch error during the compilation for the generation of C code.
18 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Victor Crespo
il 27 Mar 2020
Commentato: Ajay Pattassery
il 11 Mag 2020
I have a Simulink model built with blocks previously developed, that I have stored into two different libraries.
When I select the menu option "Update Diagram", Simulink compiles the model and doesn't show any warning or error messages, but when I try to compile it to generate the C code, the process fails and produces errors regarding data types, p.e:
### Build procedure for model: 'ModelName' aborted due to an error.
Error using tlc_c (line 179)
Parameter Value of 'ParameterName' is being cast from data type 'int32' to the data type 'int8'. Downcasts and signed/unsigned mismatches of tunable parameter expressions are not allowed in order to ensure consistent behavior between simulation and generate code.
I suppose that if Simulink is capable to compile the model without errors there must be possible that Simulink Coder does the same.
Somebody can tell me what is happening?.
It is an issue of the configuration of the code generation process?.
Thanks in advance.
0 Commenti
Risposta accettata
Ajay Pattassery
il 10 Mag 2020
The Downcast error can be avoided in code generation if the Detect Downcast feature is set to none. (By default this feature will be set to error) .
Configuration Parameters > Diagnostics > Data Validity > Parameters>Detect Downcast>none.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!