Introduction to Stateflow with Applications

This is a short chapter describing the use of boxes to extend Stateflow Chart diagrams. We describe how to create a state and changing it to a box, and how to create a box and change it to a state.
Boxes offer a convenience for organizing related items in our charts. We create a box by using the Box tool
in the Stateflow Editor window shown in Figure 8.1.
To create a Box we use the following steps:
We select the Box tool.
We move the cursor into the drawing area. In the drawing area, the mouse cursor becomes box-shaped, and we click in a desired location to create a box.
The created box appears with a question mark (?) name in its upper left-hand corner, we click the question mark label, and a text cursor appears in place of the question mark.
We enter a name for the box and click outside of the box when finished. A typical box appears as shown in Figure 8.2.
To delete a box, we click it to select it and we press the Delete key, or we choose Cut ( Ctrl+ X) from the Edit menu.
We can change an existing state to a box and back to a state with the following procedure:
We...