Stateflow    

Event Actions in a Superstate Example

The following example demonstrates the use of event actions in a superstate:

Initially the Stateflow diagram is asleep. State A.A1 is active. Event E_three occurs and awakens the Stateflow diagram. Event E_three is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:

  1. The Stateflow diagram root checks to see if there is a valid transition as a result of E_three. There is no valid transition.
  2. State A during actions (durA()) execute and complete.
  3. State A executes and completes the on event E_three action (A_one).
  4. State A checks its children for valid transitions. There are no valid transitions.
  5. State A1 during actions (durA1()) execute and complete.
  6. The Stateflow diagram goes back to sleep, waiting to be awakened by another event.

This sequence completes the execution of this Stateflow diagram associated with event E_three.


  Backtracking Behavior in Flow Graphs Example Parallel (AND) State Examples