Stateflow    

Condition Action Example

This example shows the behavior of a simple condition action in a multiple segment transition.

Initially the Stateflow diagram is asleep. State A is active. Event E_one occurs and awakens the Stateflow diagram. Conditions C_one and C_two are 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. A valid transition segment from state A to a connective junction is detected. The condition action A_one is detected on the valid transition segment and is immediately executed and completed. State A is still active.
  2. Because the conditions on the transition segments to possible destinations are false, none of the complete transitions is valid.
  3. State A during actions (durA()) execute and complete.
  1. State A remains active.

  1. 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 when state A is initially active.


  Condition Action Examples Condition and Transition Actions Example