Main Content

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 Migrate Memory Section and Shared Utility Settings from Configuration Parameters to Code Mappings Editor 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.

TokenDescription
$N

Insert system-generated name of the object for which the shared utility identifier is generated. Optional.

$C

Insert eight-character conditional checksum when $N is not specified or the Maximum identifier length does not accommodate the full length of $N. Modify checksum character length by using Shared checksum length parameter. Required.

$R

Insert root model name into identifier, replacing unsupported characters with the underscore (_) character.

$U

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

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 with 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

ApplicationSetting
DebuggingNo impact
TraceabilityUse default
EfficiencyNo impact
Safety precautionNo recommendation

Related Topics