This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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.

See Also
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.

See Also
References

MISRA C:2012, Rule 21.2

Last ChangedR2018b
Example

Recommended

  • Block name: My_Controller

  • Signal name: a_b

Not Recommended

  • Block name: My Controller

  • Signal name: 12a__b