Main Content

na_0011: Scope of Goto and From blocks

Since R2020a

Guideline Publication

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

Sub ID Recommendations

  • NA-MAAB — a

  • JMAAB — a, b, c

MATLAB Versions

All

Rule

Sub ID a

Goto block parameter tag visibility shall be set to Local.

Custom Parameter

Not Applicable

Sub ID b

The output signal of Inport block shall not exclusively connect to Goto block.

Custom Parameter

Not Applicable

Example — Correct

The output signal of Inport block connects to something other than Goto block.

Example — Incorrect

The output signal of Inport block connects exclusively to Goto block.

Sub ID c

The output signal of a From block shall not connect to an Outport block.

Custom Parameter

Not Applicable

Example — Correct

The output signal of a From block does not connect to an Outport block.

Example — Incorrect

The output signal of a From block connects to an Outport block.

Rationale

Sub ID a:

  • When the hierarchies of the Goto block and the corresponding From block are different, the relationships between the blocks can be difficult to understand.

  • Simulation errors can occur when hierarchies of the Goto block and the corresponding From block are different and a virtual subsystem changes to an Atomic subsystem.

Sub ID b:

  • When connecting the output signal of an Inport block to a Goto block, at least one branched signal connects to blocks other than the Goto block.

Verification

Model Advisor check: Check scope of From and Goto blocks (Simulink Check)

Last Changed

R2024b

Version History

Introduced in R2020a