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 — a1/a2/a3

MATLAB Versions

All

Rule

Sub ID a1

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 a2

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 a3

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 a1:

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

Sub IDs a2, a3:

  • 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

R2020a

Version History

Introduced in R2020a