Type mismatch error during the compilation for the generation of C code.
18 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Victor Crespo
el 27 de Mzo. de 2020
Comentada: Ajay Pattassery
el 11 de Mayo de 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 comentarios
Respuesta aceptada
Ajay Pattassery
el 10 de Mayo de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!