Main Content

Field name of global types


Customize generated field names of global types.

Category: Code Generation > Identifiers


Default: $N$M

Enter a macro that specifies whether, and in what order, certain text is to be included in the generated identifier. The macro can include a combination of the following format tokens.


Insert data type acronym into signal and work vector identifiers. For example, i32 for int32_t.


Insert tag indicating system hierarchy level. For root-level blocks, the tag is the text root_. For blocks at the subsystem level, the tag is of the form sN_, where N is a unique system number assigned by the Simulink® software.


Insert name-mangling text if required to avoid naming collisions.



Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated.


Insert text that you specify for the $U token. Use the Custom token text parameter to specify this text.


  • Avoid name collisions in general. One way is to avoid using default block names (for example, Gain1, Gain2...) when your model has many blocks of the same type.

  • Where possible, increase the Maximum identifier length to accommodate the length of the identifiers you expect to generate. Reserve at least three characters for name-mangling text.

  • To control the case (upper or lower case) of the text that each token represents, include decorators such as [U_] in your macro. See Control Case by Using Token Decorators.

  • The Maximum identifier length setting does not apply to type definitions.

  • This option does not impact objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).


This parameter:

  • Appears only for ERT-based targets.

  • Requires Embedded Coder® when generating code.

Command-Line Information

Parameter: CustomSymbolStrField
Type: character vector
Value: valid combination of tokens
Default: $N$M

Recommended Settings

DebuggingNo impact
TraceabilityUse default
EfficiencyNo impact
Safety precautionNo recommendation

Related Topics