| Stateflow® |  |
Best Practices for Using Events in Stateflow Charts
Use the send command to broadcast explicit events in actions
In state actions (entry, during, exit,
and on event_name) and transition actions, use
the send command to broadcast explicit events.
Using this command enhances readability of a chart and ensures that
explicit events are not mistaken for data.
Avoid defining machine-parented events
If you have multiple charts in your model, avoid defining events
where the parent is the Stateflow machine. If you broadcast an
event to all charts in your model, the order in which the charts awaken
is unknown.
Do not mix edge-triggered input events and function-call input
events in a chart
If you mix input events that use edge triggers and function
calls, the chart detects this violation during parsing or code generation.
An error message appears and chart execution stops.
Avoid using the enter implicit event to check state activity
Use the in operator instead of the enter implicit
event to check state activity. See Checking State Activity for details.
 | Counting Events | | Transferring Events Across Models |  |