Stateflow User's Guide Previous page   Next Page

Example of Action Type Execution

In State Action Types and Transition Action Types, you are introduced to the notation and meaning of the action language types in Stateflow. In this topic, you see how Stateflow action language types interact when you execute the following example Stateflow diagram:

If the Stateflow diagram is turned on, the following takes place:

  1. The default transition to state A is taken.
  2. The entry action id = x+y is executed.
  3. The event time_out is bound to state A.
  4. State A is active.

If state A is active and the Stateflow diagram receives the event event2, the following takes place:

  1. The exit action broadcast of the event time_out is executed.
  2. State A becomes inactive.
  3. The transition action data1 = 5 is executed.
  4. State B becomes active.

If state A is active and the Stateflow diagram receives the event event1, the following takes place:

  1. The condition action call to the function func1() is executed.
  2. The condition temp > 50 is evaluated. If it is true, do the remaining steps. If it is false, stop here.
  3. The exit action broadcast of the event time_out is executed.
  4. State A becomes inactive.
  5. The transition action data1 = 5 is executed.
  6. State B becomes active.

Previous page  Transition Action Types Using Operations in Actions Next page

© 1994-2005 The MathWorks, Inc.