Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Transitions (Statechart Module)

LabVIEW 2010 Statechart Module Help

Edition Date: June 2013

Part Number: 372103F-01

»View Product Info
Download Help (Windows Only)

Transitions define the conditions under which the statechart can move between states. By creating transitions between states, you specify how the statechart reacts to certain triggers or guards, which triggers cause the statechart to move to certain states, and in what order the statechart can move between states.

The statechart can take only the transitions that you define. For example, consider the following figure:

In the previous figure, the Initial pseudostate defines the state that the statechart executes first. In this situation, the first state is State 1. State 1 has an outgoing transition to State 2, and State 2 has an outgoing transition to State 3. This placement of transitions means that the statechart cannot enter State 3 without passing through State 2 first.

Notice also that State 3 has a transition that returns to State 2. You must specify these returning transitions because transitions go in one direction only. State 2 does not have a transition to State 1. This placement of transitions means that, in the previous figure, the statechart cannot return to State 1 after entering State 2.

Ports

Ports are the areas on a state that are connected by transition segments. Ports are either rectangular or triangular. Rectangular ports indicate where a transition leaves a state or connector. Rectangular ports also indicate where a transition passes through a region.

Triangular ports indicate where the transition enters a state or connector. Notice that the ports combine with the transition segments to form an arrow that indicates the direction of the transition.

Transition Node

A transition node is the object that divides the transition into segments. You use these nodes to define the trigger(s), guard, and action of the transition. LabVIEW creates these nodes automatically after you create a transition.

The following figure shows a transition node.

Note  You can see a brief description of the transition by displaying the Context Help window and moving the cursor over the transition node.

The node is divided visually into three white rectangles. The rectangle on the left, closest to the state that initiates the transition, represents the trigger for the transition. A white rectangle here means the transition is configured to use only the NULL trigger. This configuration is the default for new transitions. A blue rectangle here means the transition is configured to use at least one trigger in addition to, or instead of, the NULL trigger.

The middle rectangle indicates the presence of a guard. This rectangle is white when no guard is defined but turns blue when you define a guard. The rectangle closest to the state that terminates the transition indicates the presence of an action. This rectangle is white when no action is defined but turns blue when you define an action.

For example, the transition node in the following figure has a guard and an action. This transition node is configured to react only to the NULL trigger.

Viewing and Changing the Transition Label

Each transition node has a built-in label. To see this label, right-click a transition node you created and select Visible Items»Label. LabVIEW displays Transition as the label for this transition. You can double-click this label to change the label. You also can use the Label text box in the Configure Transition dialog box. The Show transition node labels option of the Statechart page also specifies to display the label of the transition node after you create a transition.

Transition Evaluation and Execution

Transitions have the following two phases:

  1. Evaluation—This phase occurs when the statechart receives the specified trigger. This phase also evaluates any guard that is associated with the transition. The statechart evaluates transitions according to the priority you specify.
  2. Execution—This phase, which occurs only if the guard returns TRUE, executes the specified transition action.

After the Execution phase, the statechart enters the state that terminates the transition. These phases occur during a single iteration of the statechart.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit