Subdiagrams (Statechart Module)

LabVIEW 2010 Statechart Module Help

Edition Date: June 2013

Part Number: 372103F-01

»View Product Info
Download Help (Windows Only)

By default, the LabVIEW Statechart Module displays the hierarchy of a state directly on the statechart diagram. However, because states can contain numerous regions, a complex state can make visual navigation difficult. In this situation, you can view a state as a subdiagram to simplify the visual appearance of the statechart diagram.

LabVIEW displays the contents of subdiagrams in a separate Statechart Editor window. This separation provides more space in which you can edit the contents of a state. This separation also provides a way to save space on the top-level statechart diagram.

For example, the following figure shows a statechart with two top-level states, State 1 and State 2.

Viewing State 2 as a subdiagram and then resizing State 2 results in the following statechart diagram.

In the above figure, notice that State 2 lacks an inner border. This change provides a visual distinction you can use to identify subdiagrams on a statechart diagram. Also notice how using a subdiagram saves space on the top-level statechart diagram.

The following figure shows the subdiagram itself.

In the above figure, notice that the subdiagram contents are identical to how this state appeared previously on the statechart diagram. Also notice the blue background that distinguishes the subdiagram from a top-level statechart diagram, which has a white background.

Note  You can view states in subdiagrams as subdiagrams themselves. For example, in the previous figure, you can view State 5 as a subdiagram.

In the above figure, the rectangular and triangular objects to the left of the Region are ports. Notice how these ports correspond to transitions that enter and exit State 2.

You can place outgoing ports on a subdiagram by placing a Port object, located on the Statechart Development palette, on the subdiagram. That port then appears on the top-level statechart diagram. To match ports between the statechart diagram and the subdiagram, right-click the port and select either Find Port on State or Find Port on Subdiagram, depending on whether you are viewing the statechart diagram or the subdiagram.

While viewing a subdiagram, you can change the appearance of a port by right-clicking the port and selecting either Rotate or Reverse.

Note  You cannot create incoming ports by placing a port object on a subdiagram. You create incoming ports only by creating a transition to the state.

WAS THIS ARTICLE HELPFUL?

Not Helpful