Using Stateflow     Search    Help Desk 

Create and Label the Superstates

To create a superstate, create a state and resize so that it includes or surrounds the desired substates. These steps show how to create and label the superstates.

   1.
Click on the State button


from the toolbar. Using the sample solution as a guide, place the Ride superstate in the drawing area.
   2.
Resize the state to create the superstate. Dragging any one of the state's corners resizes the state. You know you are at the resizing location on the state border when the cursor appears as a double-ended arrow.
   3.
Click on the ? within the superstate and enter the text Ride. Deselect the superstate to exit the edit.
   4.
Click on the State button


and place the Power_on state in the drawing area.
   5.
Resize the Power_on state to create a superstate. Dragging any one of the state's corners resizes the state. You know you are at the resizing location on the state border when the cursor appears as a double-ended arrow.
   6.
Click on the ? within the OR superstate and enter the text Power_on. Deselect the OR superstate to exit the edit.
   7.
Click on the State button


and place the Timer state in the drawing area.
   8.
Resize the Timer state to create a superstate. Dragging any one of the state's corners resizes the state. You know you are at the resizing location on the state border when the cursor appears as a double-ended arrow.
   9.
Click on the ? within the OR superstate and enter the text Timer. Deselect the OR superstate to exit the edit.
   10.
Display the state shortcut menu by placing the cursor inside the borders of the Power_on state but outside the borders of any of Power_on's substates and clicking the right mouse button. Choose the Parallel (AND) decomposition menu item.

Sample Snapshot

Your Stateflow diagram should now look similar to this Stateflow diagram.




[ Previous | Help Desk | Next ]