Naming Considerations

hisl_0031: Model file names

ID: Titlehisl_0031: Model file names
Description

For model file names:

  • Use these characters: a-z, A-Z, 0-9, and the underscore (_).

  • Use strings that are more than 2 and less than 64 characters. (Not including the dot and file extension).

Do not:

  • Start the name with a number.

  • Use underscores at the beginning or end of a string.

  • Use more than one consecutive underscore.

  • Use underscores in file extensions.

  • Use reserved identifiers.

Rationale
  • Readability

  • Compiler limitations

  • Model-to-generated code traceability

Model Advisor Checks
  • By Task > Modeling Standards for DO-178C/DO-331 > High-Integrity Systems > Naming > Check model file name

  • By Task > Modeling Standards for IEC 61508 > High-Integrity Systems > Naming > Check model file name

  • By Task > Modeling Standards for IEC 62304 > High-Integrity Systems > Naming > Check model file name

  • By Task > Modeling Standards for EN 50128 > High-Integrity Systems > Naming > Check model file name

  • By Task > Modeling Standards for ISO 26262 > High-Integrity Systems > Naming > Check model file name

For check details, see Check model file name (Simulink Check).

See Also
References

ISO 26262-6, Table 1 (1h) 'Use of naming conventions'

Last ChangedR2018b
Examples

Recommended

  • My_model.slx

Not Recommended

  • _My__model.slx

  • 2018_01_11_model.slx

  • New.slx

hisl_0032: Model object names

ID: Titlehisl_0032: Model object names
Description

For the following model object names:

  • Signals

  • Parameters

  • Blocks

  • Named Stateflow® objects (States, Boxes, Simulink® Functions, Graphical Functions, Truth Tables)

Use:

  • These characters: a-z, A-Z, 0-9, and the underscore (_).

  • Strings that are fewer than 32 characters.

Do not:

  • Start the name with a number.

  • Use underscores at the beginning or end of a string.

  • Use more than one consecutive underscore.

  • Use reserved identifiers.

Notes

Reserved names:

  • MATLAB® keywords

  • Reserved keywords for C, C++, and code generation. For complete list, see Reserved Keywords (Simulink Coder).

  • int8 , uint8

  • int16, uint16

  • int32, uint32

  • inf, Inf

  • NaN, nan

  • eps

  • intmin, intmax

  • realmin, realmax

  • pi

  • infinity

  • Nil

Rationale
  • Readability

  • Compiler limitations

  • Model-to-generated code traceability

Model Advisor Checks
  • By Task > Modeling Standards for DO-178C/DO-331 > High-Integrity Systems > Naming > Check model object names

  • By Task > Modeling Standards for IEC 61508 > High-Integrity Systems > Naming > Check model object names

  • By Task > Modeling Standards for IEC 62304 > High-Integrity Systems > Naming > Check model object names

  • By Task > Modeling Standards for EN 50128 > High-Integrity Systems > Naming > Check model object names

  • By Task > Modeling Standards for ISO 26262 > High-Integrity Systems > Naming > Check model object names

For check details, see Check model object names (Simulink Check).

See Also
References

  • MISRA C:2012, Rule 21.2

  • ISO 26262-6, Table 1 (1h) 'Use of naming conventions'

Last ChangedR2018b
Example

Recommended

  • Block name: My_Controller

  • Signal name: a_b

Not Recommended

  • Block name: My Controller

  • Signal name: 12a__b