Stateflow    

Cyclic Behavior to Avoid with Condition Actions Example

This example shows a notation to avoid when using event broadcasts as condition actions because the semantics result in cyclic behavior.

Initially the Stateflow diagram is asleep. State On is active. Event E_one occurs and awakens the Stateflow diagram. 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.
  1. A valid transition from state On to state Off is detected.

  1. The condition action on the transition broadcasts event E_one.
  2. Event E_one is detected on the valid transition, which is immediately executed. State On is still active.
  3. The broadcast of event E_one awakens the Stateflow diagram a second time.
  4. Go to step 1.

Step 1 to 5 continue to execute in a cyclical manner. The transition label indicating a trigger on the same event as the condition action broadcast event results in unrecoverable cyclic behavior. This sequence never completes when event E_one is broadcast and state On is active.


  Condition Actions to Broadcast Events to Parallel (AND) States Example Default Transition Examples