Stateflow    

Self-Loop Transition Example

This example shows the behavior of a self-loop transition using a connective junction.

Initially the Stateflow diagram is asleep. State A is active. Event E_one occurs and awakens the Stateflow diagram. Condition [C_one] is false. Event E_one 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_one. There is a valid transition segment from state A to the connective junction. The transition segment labeled with a condition and action is evaluated for validity. Because the condition [C_one] is not valid, the complete transition from state A to state B is not valid. The transition segment from the connective junction back to state A is valid.
  2. State A exit actions (exitA()) execute and complete.
  3. State A is marked inactive.
  4. The transition action A_two is executed and completed.
  5. State A is marked active.
  6. State A entry actions (entA()) execute and complete.
  7. 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_one.


  If-Then-Else Decision Construct Example For Loop Construct Example