Main Content

Maximum identifier length

Specify maximum number of characters in identifiers

Model Configuration Pane: Code Generation / Identifiers


Specify maximum number of characters in generated function, type definition, variable names.


31 (default) | integer

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 possibly, the name-mangling text. 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.

Recommended Settings

DebuggingValid value
EfficiencyNo impact
Safety precaution>30

Programmatic Use

Parameter: MaxIdLength
Type: integer
Value: valid value
Default: 31

Version History

Introduced before R2006a