Configuring states

Configuring a state includes naming it and optionally assigning a behavior (C code) to selected actions. A state has three pre-defined actions (entry, exit, and do) and any number of inner transitions that are fired by triggers.

To configure a state

1.    Right-click in the title bar of State1.

2.    In the State Properties dialog under Options, do the following:

      Under Name, enter Init.

      Under Color, select a color for the border and a color for the header.

3.    Click the Activity Manager tab to select an action and enter behaviors.

4.    Under Actions, select Entry and click Add Action.

5.    Under Edit Behavior, enter the C code to indicate the pump is OFF, as shown below.

Note: If you are unfamiliar with the C language, refer to C: A Software Engineering Approach.

6.    Click OK.

Your state chart will look like this:

Creating a simple state chart initialstate and state blks a

7.    Repeat steps 1 – 6 for State2 and State3 so that your state chart looks like this:

Creating a simple state chart Configuring states c