- Modify the MATLAB enum to go from 0-9
- Modify the C enum to go from 1-10
Unexpected or internal error encountered in createMismatchError: Incorrect Enum error type
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 30 de Jun. de 2022
Respondida: MathWorks Support Team
el 7 de Jul. de 2022
I encountered the following error when generating code for my model in R2021b:
Unexpected or internal error encountered in "in CGIR: B:\matlab\toolbox\shared\slcc\src\slcc_blocks\src\slcc_blocks_utils.cpp line 398: In createMismatchError: Incorrect Enum error type". Please report this to MathWorks if you can cause it to recur
When I try the same model in R2022a, I get the following error:
Value of enumeration elements specified for symbol 'Name' for C Function block does not match the symbol's type in the custom code. Check the enumeration definition for 'Filename' in Configuration Parameters > Simulation Target pane.
Respuesta aceptada
MathWorks Support Team
el 30 de Jun. de 2022
That error happens because the enum values in MATLAB don't match the enum values defined in their C Code. For example, if the MATLAB enum values range from 1-10 and the enum values in the C code range from 0-9, this causes the error. So to resolve the error, the two options are:
In essence, making the enum values match will resolve the error.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!