Unexpected or internal error encountered in createMismatchError: Incorrect Enum error type

19 visualizaciones (últimos 30 días)
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
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:
  1. Modify the MATLAB enum to go from 0-9
  2. Modify the C enum to go from 1-10
In essence, making the enum values match will resolve the error.

Más respuestas (0)

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by