Main Content

jm_0012: Usage restrictions of events and broadcasting events

Since R2020a

Guideline Publication

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

Sub ID Recommendations

  • NA-MAAB — No recommendations

  • JMAAB — a, b1/b2

MATLAB Versions

All

Rule

Sub ID a

Stateflow events shall be used only in Stateflow Chart (Stateflow) output.

Custom Parameter

Not Applicable

Example — Correct

Event is used only in the Stateflow Chart output.

Example — Incorrect

Event is used other than in the Stateflow Chart output.

Sub ID b1

The send (Stateflow) syntax send(event_name, state_name) shall be used to broadcast Stateflow events.

Custom Parameter

Not Applicable

Example — Correct

Event is broadcast using the send syntax.

Example — Incorrect

The state that receives the broadcast has not been defined in the send (Stateflow) syntax.

Sub ID b2

The send (Stateflow) syntax send(state_name.event_name) with the qualified event name shall be used to broadcast Stateflow events.

Custom Parameter

Not Applicable

Example — Correct

The qualified event name is used in the event being broadcast.

Example — Incorrect

The state that receives the broadcast has not been described in the send (Stateflow) syntax.

Rationale

Sub ID a:

  • Recursive processing in a chart is prevented by using Stateflow events in the Stateflow Chart output only.

Sub IDs b1, b2:

  • Improves readability because transitions that are triggered by events are clearly identified.

Verification

Model Advisor check: Check for usage of events in Stateflow charts (Simulink Check)

Last Changed

R2024b

Version History

Introduced in R2020a