Why am I receiving "Property 'EnumDefinition' does not exist" error when using a custom TLC file in Embedded Coder R2021a?

I am using Embedded Coder R2021a Update 8 on Microsoft Windows 10.
I am trying to create a custom TLC file to customize generated code, and I want this system target file to support model referencing. I am writing the custom TLC file and custom callback handler to support model referencing by following this documentation page:
 
 
When I try to generate code using this custom TLC and callback handler, I receive the following fatal error:
Property 'EnumDefinition' does not exist
and there is no further information displayed. Why is this error occurring, and how can I fix it?

 Accepted Answer

This error is due to the fact that the "targetComponentClass" is being set by the custom TLC file, as only MathWorks shipped files should set this field in TLC files, see here:
 
 
To resolve this issue, please perform the following steps:
  1. Remove the "targetComponentClass" section (bounded by the directives BEGIN_CONFIGSET_TARGET_COMPONENT and END_CONFIGSET_TARGET_COMPONENT) from the custom TLC
  2. Reconfigure the model to use the right settings:
    1. In "Configuration Parameters > Code Generation" under "Model Settings", change the system target file to "ert.tlc". Hit "Apply", then "OK", then "Apply".
    2. In the same location, change the system target file back to the custom TLC. Hit "Apply", then "OK", then "Apply".
These steps will fix the issue with the custom TLC and re-load the corrected TLC file into the model. The error will no longer appear.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Release

R2021a

Community Treasure Hunt

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

Start Hunting!