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

조회 수: 7 (최근 30일)
Mihir
Mihir 2025년 4월 10일
댓글: Mihir 2025년 7월 8일
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.

답변 (1개)

Altaïr
Altaïr 2025년 4월 16일
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
Mihir
Mihir 2025년 7월 8일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by