Main Content

jc_0602: Consistency in model element names

Since R2020a

Guideline Publication

Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®

Sub ID Recommendations

  • NA-MAAB — No recommendations

  • JMAAB — a

MATLAB Versions

All

Rule

Sub ID a

These names shall match when they are directly connected by using signal lines.

  • Inport block name

  • Outport block name

  • Structural subsystem input port label name

  • Structural subsystem output port label name

  • From block tag name

  • Goto block tag name

  • Signal line signal name

Exceptions

A signal line that connects to one of the following subsystem types can have a name that differs from that of the subsystem port label:

  • Subsystems linked to a library

  • Reusable subsystems

When a combination of Inport, Outport, and other blocks have the same name, use a suffix or prefix for the Inport and Outport blocks. Any prefix or suffix can be used for ports, but they must be consistent. For example, the Inport block uses “in” and Outport block uses “out”.

Note

Inport and Outport blocks must have different names and signal names.

Custom Parameter

Not Applicable

Example — Correct

Names of model elements that connect directly to signal lines are consistent.

Example — Incorrect

Inconsistent names for model elements that connect directly to signal lines.

Rationale

Sub ID a:

  • Prevent misconnected signal lines.

  • Readability is impaired.

  • Deviation from the rule can make it difficult to maintain the integrity of the model and code.

Verification

Model Advisor check: Check for consistency in model element names (Simulink Check)

Last Changed

R2020a

Version History

Introduced in R2020a