Creating and Manipulating Transitions (Statechart Module)

LabVIEW 2010 Statechart Module Help

Edition Date: June 2013

Part Number: 372103F-01

»View Product Info
Download Help (Windows Only)

You can create a transition between a state and any other statechart object except a region. The following sections provide information about creating transitions between objects on a statechart diagram.

Note  When you create a transition, the order in which you click the objects establishes the direction of the transition. The first state you click is the state from which the transition originates. The second object you click is the object at which the transition terminates.

Creating a Transition between Two States

You can create a transition between two states that exist in the same statechart. These states can exist in any region. Complete the following steps to create a transition between two states.

  1. Place two states on the statechart diagram.
  2. Move the cursor over the border of the first state until the cursor changes to the Wiring tool.
  3. Click the border to begin placing the transition.
  4. Move the cursor over the border of the second state.
  5. Click the border again to complete the transition. Notice the transition node that appears in between the transition segments.
  6. Configure the transition.

Creating a Transition between a State and a Pseudostate or Connector

To create a transition between a state and a pseudostate, move the cursor over the center of the pseudostate on the statechart diagram. After the cursor changes to the Wiring tool, click the pseudostate to initiate or terminate the transition.

To create a transition between a state and a connector, move the cursor over the gray area of the connector on the statechart diagram. After the cursor changes to the Wiring tool, click to initiate or terminate the transition.

Duplicating a Transition Node

To duplicate a transition node, press the <Ctrl> key and drag a transition node to another location on the statechart diagram to duplicate all triggers, guards, and actions of the original transition node. Then, connect the segments of the duplicated node to other states or pseudostates.

Note  If you configure a trigger for a transition node, duplicate that node, and then create a transition from an Initial pseudostate to that node, errors appear when you generate code for that statechart. These errors appear because transitions that leave an Initial pseudostate cannot have triggers. Complete the following steps to correct these errors.
  1. Double-click the transition node that exits the Initial pseudostate.
  2. Click the OK button to save changes and return to the statechart diagram to remove all triggers from the node.

Reversing Transition Direction

Recall that transitions are unidirectional. In some cases you might create a transition, define some logic for that transition, and then realize the transition needs to go the other way. You can reverse the direction of a transition without deleting and re-creating the transition node, which means that reversing the direction of a transition maintains any transition logic you configure.

For example, consider the following figure:

Complete the following steps to reverse the direction of this transition.

  1. Use the Positioning tool to click either segment of the transition.
  2. Press the <Delete> key to delete the segment.
  3. Delete the other transition segment. The transition node now is unconnected to either state.
  4. Right-click the transition node and select Reverse. The transition node now points the other way.
  5. Using the Wiring tool, move the cursor over the triangular end of the transition node until LabVIEW displays a tip strip that reads Segment Out.
  6. Click the head to initiate a transition segment.
  7. Create a transition segment to the border of State 1. The statechart diagram now resembles the following figure:

    Note  Recall that the order in which you click the objects establishes the order of the transition. Therefore, you cannot create this segment by clicking State 1 and then the head of the transition node. The LabVIEW Statechart Module interprets this sequence as you attempting to create a transition segment to an object that does not allow any incoming segments.
  8. Create a transition segment from State 2 to the other end of the transition node.

The transition now goes from State 2 to State 1 instead of from State 1 to State 2. The statechart diagram now resembles the following figure:

Notice the transition node itself remains unchanged except for the visual appearance. Reversing transition direction preserves any logic you had configured for this node.

Manipulating a Transition Node

You can adjust the placement and orientation of transition nodes by right-clicking this node and selecting the appropriate option.

Note  Manipulating a transition node does not affect the direction of the transition itself. The manipulation is for visual purposes only.

Select the Rotate option to rotate the node 90 degrees. Rotating a transition node is useful if you want to move the transition node from a vertical transition segment to a horizontal transition segment, or vice-versa.

Select the Reverse option to reverse the beginning and end of the transition node. If the end of the node faces right and you select this option, the end of the node faces left.

(Windows) To view related topics, click the Locate button, shown at left, in the toolbar at the top of this window. The LabVIEW Help highlights this topic in the Contents tab so you can navigate the related topics.

WAS THIS ARTICLE HELPFUL?

Not Helpful