| Real-Time Workshop® | ![]() |


| On this page… |
|---|
Generate scalar inlined parameter as |
Select the automatically generated identifier naming rules.
Customize generated global variable identifiers.
Default: $R$N$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
| $R | Insert root model name into identifier, replacing any unsupported characters with the underscore (_) character. Required for model referencing. |
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 a name mangling string.
If you specify $R, the value you specify for Maximum identifier length must be large enough to accommodate full expansions of the $R and $M tokens.
When a name conflict occurs between an identifier within the scope of a higher-level model and an identifier within the scope of a referenced model, the code generator preserves the identifier from the referenced model. Name mangling is performed on the identifier in the higher-level model.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrGlobalVar |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$R$N$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $R$N$M |
Customize generated global type identifiers.
Default: $N$R$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
| $R | Insert root model name into identifier, replacing any unsupported characters with the underscore (_) character. Required for model referencing. |
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 a name mangling string.
If you specify $R, the value you specify for Maximum identifier length must be large enough to accommodate full expansions of the $R and $M tokens.
When a name conflict occurs between an identifier within the scope of a higher-level model and an identifier within the scope of a referenced model, the code generator preserves the identifier from the referenced model. Name mangling is performed on the identifier in the higher-level model.
Name mangling conventions do not apply to type names (that is, typedef statements) generated for global data types. The Maximum identifier length setting does not apply to type definitions. If you specify $R, the code generator includes the model name in the typedef.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrType |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$N$R$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $N$R$M |
Customize generated field names of global types.
Default: $N$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $A | Insert data type acronym (for example, i32 for long integers) into signal and work vector identifiers. |
| $H | Insert tag indicating system hierarchy level. For root-level blocks, the tag is the string 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. |
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
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 a name mangling string.
The Maximum identifier length setting does not apply to type definitions.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrField |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$N$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $N$M |
Customize generated global type identifiers.
Default: $R$N$M$F
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $F | Insert method name (for example, _Update for update method). Empty for Stateflow functions. |
| $H | Insert tag indicating system hierarchy level. For root-level blocks, the tag is the string 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. Empty for Stateflow functions. |
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
| $R | Insert root model name into identifier, replacing any unsupported characters with the underscore (_) character. Required for model referencing. |
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 a name mangling string.
If you specify $R, the value you specify for Maximum identifier length must be large enough to accommodate full expansions of the $R and $M tokens.
When a name conflict occurs between an identifier within the scope of a higher-level model and an identifier within the scope of a referenced model, the code generator preserves the identifier from the referenced model. Name mangling is performed on the identifier in the higher-level model.
Name mangling conventions do not apply to type names (that is, typedef statements) generated for global data types. The Maximum identifier length setting does not apply to type definitions. If you specify $R, the code generator includes the model name in the typedef.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrFcn |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$R$N$M$F' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $R$N$M$F |
Customize generated local temporary variable identifiers.
Default: $N$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
| $R | Insert root model name into identifier, replacing any unsupported characters with the underscore (_) character. Required for model referencing. |
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 a name mangling string.
If you specify $R, the value you specify for Maximum identifier length must be large enough to accommodate full expansions of the $R and $M tokens.
When a name conflict occurs between an identifier within the scope of a higher-level model and an identifier within the scope of a referenced model, the code generator preserves the identifier from the referenced model. Name mangling is performed on the identifier in the higher-level model.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrTmpVar |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$N$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $N$M |
Customize generated local block output variable identifiers.
Default: rtb_$N$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $A | Insert data type acronym (for example, i32 for long integers) into signal and work vector identifiers. |
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
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 a name mangling string.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrBlkIO |
| Type: string |
| Value: any valid combination of tokens |
| Default: 'rtb_$N$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | rtb_$N$M |
Customize generated constant macro identifiers.
Default: $R$N$M
Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include a combination of the following format tokens.
| Token | Description |
|---|---|
| $M | Insert name mangling string if required to avoid naming collisions. Required. |
| $N | Insert name of object (block, signal or signal object, state, parameter or parameter object) for which identifier is being generated. |
| $R | Insert root model name into identifier, replacing any unsupported characters with the underscore (_) character. Required for model referencing. |
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 a name mangling string.
If you specify $R, the value you specify for Maximum identifier length must be large enough to accommodate full expansions of the $R and $M tokens.
When a name conflict occurs between an identifier within the scope of a higher-level model and an identifier within the scope of a referenced model, the code generator preserves the identifier from the referenced model. Name mangling is performed on the identifier in the higher-level model.
This option does not affect objects (such as signals and parameters) that have a storage class other than Auto (such as ImportedExtern or ExportedGlobal).
This parameter only appears for ERT-based targets.
| Parameter: CustomSymbolStrMacro |
| Type: string |
| Value: any valid combination of tokens |
| Default: '$R$N$M' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid combination of tokens |
| Efficiency | No impact |
| Safety precaution | $R$N$M |
Increase the minimum number of characters used for generating name mangling strings that help avoid name collisions.
Default: 1
Specify an integer value that indicates the minimum number of characters the code generator is to use when generating a name mangling string. As necessary, the minimum value automatically increases during code generation as a function of the number of collisions. A larger value reduces the chance of identifier disturbance when you modify the model.
Minimize disturbance to the generated code during development, by specifying a value of 4. This value is conservative and safe; it allows for over 1.5 million collisions for a particular identifier before the mangle length increases.
Set the value to reserve at least three characters for the name mangling string. The length of the name mangling string increases as the number of name collisions increases.
This parameter only appears for ERT-based targets.
| Parameter: MangleLength |
| Type: integer |
| Value: any valid value |
| Default: 1 |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | 1 |
| Efficiency | No impact |
| Safety precaution | 4 |
Specify maximum number of characters in generated function, type definition, variable names.
Default: 31
Minimum: 31
Maximum: 256
You can use this parameter to limit the number of characters in function, type definition, and variable names.
Consider increasing identifier length for models having a deep hierarchical structure.
When generating code from a model that uses model referencing, the Maximum identifier length must be large enough to accommodate the root model name and the name mangling string (if any). A code generation error occurs if Maximum identifier length is too small.
This parameter must be the same for both top-level and referenced models.
When a name conflict occurs between a symbol within the scope of a higher level model and a symbol within the scope of a referenced model, the symbol from the referenced model is preserved. Name mangling is performed on the symbol from the higher level model.
| Parameter: MaxIdLength |
| Type: integer |
| Value: any valid value |
| Default: 31 |
| Application | Setting |
|---|---|
| Debugging | Any valid value |
| Traceability | >30 |
| Efficiency | No impact |
| Safety precaution | >30 |
Generating Code for Model Referencing
Control expression of scalar inlined parameter values in the generated code.
Default: Literals
Generates scalar inlined parameters as numeric constants. This setting can help with debugging TLC code, as it makes it easy to search for parameter values in the generated code.
Generates scalar inlined parameters as variables with #define macros. This setting makes generated code more readable.
This parameter only appears for ERT-based targets.
This parameter is enabled by Inline parameters.
| Parameter: InlinedPrmAccess |
| Type: string |
| Value: 'Literals' | 'Macros' |
| Default: 'Literals' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Macros |
| Efficiency | Literals |
| Safety precaution | No impact |
Specify rules for naming signals in generated code.
Default: None
Makes no change to signal names when creating corresponding identifiers in generated code. Signal identifiers in the generated code match the signal names that appear in the model.
Uses all uppercase characters when creating identifiers for signal names in the generated code.
Uses all lowercase characters when creating identifiers for signal names in the generated code.
Uses the M-file function specified with the M-function parameter to create identifiers for signal names in the generated code.
This parameter only appears for ERT-based targets.
Setting this parameter to Custom M-function enables M-function.
This parameter must be the same for top-level and referenced models.
| Parameter: SignalNamingRule |
| Type: string |
| Value: 'None' | 'UpperCase' | 'LowerCase' | 'Custom' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Force upper case |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify rule for naming identifiers in generated code.
Default: ''
Enter the name of an M-file that contains the naming rule to be applied to signal, parameter, or #define parameter identifiers in generated code. Examples of rules you might program in such an M-file function include:
Remove underscore characters from signal names.
Add an underscore before uppercase characters in parameter names.
Make all identifiers uppercase in generated code.
M-file must be in the MATLAB path.
This parameter only appears for ERT-based targets.
This parameter is enabled by Signal naming.
This parameter must be the same for top-level and referenced models.
| Parameter: DefineNamingFcn |
| Type: string |
| Value: any M-file |
| Default: '' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify rule for naming parameters in generated code.
Default: None
Makes no change to parameter names when creating corresponding identifiers in generated code. Parameter identifiers in the generated code match the parameter names that appear in the model.
Uses all uppercase characters when creating identifiers for parameter names in the generated code.
Uses all lowercase characters when creating identifiers for parameter names in the generated code.
Uses the M-file function specified with the M-function parameter to create identifiers for parameter names in the generated code.
This parameter only appears for ERT-based targets.
Setting this parameter to Custom M-function enables M-function.
This parameter must be the same for top-level and referenced models.
| Parameter: ParamNamingRule |
| Type: string |
| Value: 'None' | 'UpperCase' | 'LowerCase' | 'Custom' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Force upper case |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify rule for naming #define parameters (defined with storage class Define (Custom)) in generated code.
Default: None
Makes no change to #define parameter names when creating corresponding identifiers in generated code. Parameter identifiers in the generated code match the parameter names that appear in the model.
Uses all uppercase characters when creating identifiers for #define parameter names in the generated code.
Uses all lowercase characters when creating identifiers for #define parameter names in the generated code.
Uses the M-file function specified with the M-function parameter to create identifiers for #define parameter names in the generated code.
This parameter only appears for ERT-based targets.
Setting this parameter to Custom M-function enables M-function.
This parameter must be the same for top-level and referenced models.
| Parameter: DefineNamingRule |
| Type: string |
| Value: 'None' | 'UpperCase' | 'LowerCase' | 'Custom' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Force upper case |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to use the same reserved names as those specified in the Simulation Target > Symbols pane.
Default: Off
Enables using the same reserved names as those specified in the Simulation Target > Symbols pane.
Disables using the same reserved names as those specified in the Simulation Target > Symbols pane.
| Parameter: UseSimReservedNames |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Enter the names of variables or functions in the generated code that match the names of variables or functions specified in custom code.
Default: {}
This action changes the names of variables or functions in the generated code to avoid name conflicts with identifiers in custom code. Reserved names must be shorter than 256 characters.
Do not enter Real-Time Workshop keywords since these names cannot be changed in the generated code. For a list of keywords to avoid, see Reserved Keywords in the Real-Time Workshop User's Guide.
Start each reserved name with a letter or an underscore to prevent error messages.
Each reserved name must contain only letters, numbers, or underscores.
Separate the reserved names using commas or spaces.
You can also specify reserved names by using the command line:
config_param_object.set_param('ReservedNameArray', {'abc','xyz'})where config_param_object is the object handle to the model settings in the Configuration Parameters dialog box.
| Parameter: ReservedNameArray |
| Type: string array |
| Value: any reserved names shorter than 256 characters |
| Default: {} |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
![]() | Real-Time Workshop Pane: Comments | Real-Time Workshop Pane: Custom Code | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |