Stateflow User's Guide Previous page   Next Page

Simulating Parallel States

In Creating Parallel States, you create parallel states, that each have their own Stateflow diagram. Observe the behavior of each parallel state during simulation of the Stateflow diagram in the model SFcontrol8 in the following steps.

  1. Start the simulation.
  1. Parallel state FAN1 becomes active followed by its default substate Off.

    Parallel state FAN2 becomes active followed by its default substate Off.

  1. Use the Manual Switch block to send an on_switch event.
  1. FAN1 substate On becomes active.

    FAN2 substate On becomes active because FAN1 substate On is active and the temperature is greater than 120.

  1. Use the Manual Switch block to send an off_switch event.
  1. FAN1 substate Off becomes active.

    FAN2 substate Off becomes active because FAN1 substate Off is active.

  1. Change the input value for temp to 110 and repeat steps 2 and 3.
  1. This time notice that the Off state of FAN2 stays active.


Previous page  Creating Parallel States Stateflow in Simulink Next page

© 1994-2005 The MathWorks, Inc.