Shared utilities identifier format
Customize shared utility identifiers
Model Configuration Pane: Code Generation / Identifiers
Description
Customize shared utility identifiers.
Dependencies
This parameter:
Appears only for ERT-based targets.
Appears only for C++ and AUTOSAR code generation.
Requires Embedded Coder® when generating code.
Settings
$N$C
(default) | stringCustomize generated shared utility identifier names.
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.
Token | Description |
---|---|
$N | Insert system-generated name of the object for which the shared utility identifier is generated. Optional. |
$C | Insert eight-character conditional checksum when |
$R | Insert root model name into identifier, replacing unsupported characters with the underscore ( |
$U | Insert text that you specify for the |
Tips
Where possible, increase the Maximum identifier length to accommodate the length of the identifiers that you expect to generate.
The checksum token
$C
is required. If$C
is specified without$N
or$R
, the checksum is included in the identifier name. Otherwise, the code generator includes the checksum when necessary to prevent name collisions.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 of Identifiers by Using Basic Token Decorators.If you specify
$N
or$R
, then the checksum is included in the identifier name only when the identifier length is too short to accommodate the fully expanded format text. The code generator includes the checksum and truncates$N
or$R
until the length is equal to Maximum identifier length. When necessary, an underscore is inserted to separate tokens.If you specify
$N
and$R
, then the checksum is included in the identifier name only when the identifier length is too short to accommodate the fully expanded format text. The code generator includes the checksum and truncates$N
, and if required,$R
, until the length is equal to Maximum identifier length. When necessary, an underscore is inserted to separate tokens.Descriptive text helps make the identifier name more accessible.
For versions prior to R2016a, the Shared utilities identifier format parameter does not support the
$R
token. For a model, if the Shared utilities identifier format parameter includes a$R
token, and you export the model to a version prior to R2016a, the Shared utilities identifier format parameter defaults to$N$C
.For C code generation, use the Embedded Coder dictionary to create a function customization template that specifies the naming rule, then apply the template by using the Code Mappings editor.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | Use default |
Efficiency | No impact |
Safety precaution | No recommendation |
Programmatic Use
Parameter: CustomSymbolStrUtil |
Type: character vector |
Value: valid combination of tokens |
Default: $N$C |
Version History
Introduced in R2013b