Stateflow    

Processing Events

When an event occurs, it is processed from the top or root of the Stateflow diagram down through the hierarchy of the diagram. At each level in the hierarchy, any during and on event_name actions for the active state are executed and completed and then a check for the existence of a valid explicit or implicit transition among the children of the state is conducted. The examples in this chapter demonstrate the top-down processing of events.

All events, with the exception of the output edge trigger to Simulink (see the following note), have the following execution in a Stateflow diagram:

  1. If the receiver of the event is active, then it is executed (see Executing an Active Chart and Executing an Active State). (The event receiver is the parent of the event unless the event was explicitly directed to a receiver using the send() function.)
  2. If the receiver of the event is not active, nothing happens.
  3. After broadcasting the event, the broadcaster performs early return logic based on the type of action statement that caused the event.
  1. For an understanding of early return logic, see Early Return Logic for Event Broadcasts.


  Sources for Stateflow Events Executing a Chart