Shared utilities identifier format
Description
Customize shared utility identifiers.
Category: Code Generation > Identifiers
Note
Starting in R2018a, for new models, do not use this configuration parameter. Instead, use the Embedded Coder® Dictionary to create a function customization template that specifies the naming rule, then apply the template by using the Code Mapping editor. See Migration of Memory Section and Shared Utility Settings from Configuration Parameters to Code Mappings and Configure Naming of Generated Functions.
Settings
Default: $N$C
Customize 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 by Using 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
.
Dependency
This parameter:
Appears only for ERT-based targets.
Requires Embedded Coder when generating code.
Command-Line Information
Parameter:
CustomSymbolStrUtil |
Type: character vector |
Value: valid combination of tokens |
Default:
$N$C |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | Use default |
Efficiency | No impact |
Safety precaution | No recommendation |