Signal names in code-generated files contain random suffixes appended to it.

8 views (last 30 days)
Hi,
I'm trying to generate C code from my Simulink model. For a few signals (not all), I see a 5-letter suffix appended to the signal name. For example, a signal named "IVCU_DrvMod" becomes "IVCU_DrvMod_mmra" in the C file. Is this a known issue with Simulink models, and should I be making any changes to my settings to fix this one and for all?
Thanks.

Answers (1)

Altaïr
Altaïr on 16 Apr 2025
Hey @Mihir,
The naming of variables and functions in the generated C code is influenced by the naming rules set within the Identifiers tab in the model's Configuration Parameters.
These rules allow for customization of generated identifiers through the use of identifier naming rules. Such a rule is essentially a macro that includes a mix of literal text, tokens, and token decorators. Depending on the token type, the code generator substitutes the tokens in the macro with specific text values.
For further details on controlling identifier formats, the following command can be used to access more information:
web(fullfile(docroot, 'ecoder/ug/specify-identifier-formats.html'))
This page also provides an example demonstrating how to customize generated identifiers by setting the Identifier format control parameters found in the Identifiers pane within the Configuration Parameters dialog box.
  1 Comment
Mihir
Mihir on 8 Jul 2025
Thanks for the answer @Altaïr. The issue is that even if I change my model configuration set, the model is appending the 5-letter suffix for a select few signals (which are outputs from the model) without affecting the rest. I've also tried clearing the cache from any previous model builds, but without any luck.

Sign in to comment.

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!