• No results found

CUSTOMIZING STRUCTURES

In document Virtual Instrumentation Using Labview (Page 188-190)

8.4.1 Placing Structures on the Block Diagram

Complete the following steps to place a structure on the block diagram.

Step 1: Select a structure on the Structures palette. The cursor becomes a small icon of the structure.

Step 2: Click the block diagram where you want to place the top corner of the structure and move the cursor down and to the right or left.

Step 3: Click the block diagram again when the structure is the size you want. After you place the structure, you can resize it.

8.4.2 Placing Objects inside Structures

Place an object inside a structure by dragging it inside the structure or by building the structure around the object. You cannot put an object inside a structure by moving the structure over the object.

Complete the following steps to practice placing objects inside a structure.

Step 1: Place the Case structure on the block diagram.

Step 2: Place the Tick Count (ms) function inside the structure.

Step 3: Move the Tick Count (ms) function close to the border of the structure. Notice that when you place or move an object in a structure near the structure border, the structure resizes to add space for that object. To disable the automatic resizing behavior for a structure, right-click the structure border and select Auto Grow from the shortcut menu to remove the checkmark.

Step 4: Move the Tick Count (ms) function outside the structure.

Step 5: Place another structure around the Tick Count (ms) function.

Step 6: Select the second structure and delete it. Notice that you also deleted the function inside the structure.

Step 7: Place another Tick Count (ms) function outside the remaining structure.

Step 8: Move the structure over the Tick Count (ms) function. The shadow on the function indicates that the function is on top of the structure but is not inside it.

Step 9: Select the Case structure and delete it. Notice that you did not delete the function because it was not inside the structure.

8.4.3 Removing Structures without Deleting Objects in the Structure

Complete the following steps to remove a structure without deleting the objects in the structure.

Step 1: Right-click the structure you want to remove.

Step 2: Select Remove For Loop from the shortcut menu or the similar option for any of the other structures.

With For Loops and While Loops, LabVIEW copies the contents of the loop to the block diagram and automatically connects any elements wired through tunnels.

Removing a Case, Event, Flat Sequence, or Stacked Sequence structure preserves only the current case or frame and any front panel terminals. All other cases or frames are deleted. LabVIEW warns you that you will lose hidden cases or frames and asks if you want to cancel the operation.

8.4.4 Resizing Structures

Complete the following steps to resize a structure on the block diagram.

Step 1: Move the positioning tool over the structure border. Resizing handles appear at the corners of the structure and in the middle of each structure border.

Step 2: Move the cursor over a resizing handle to change the cursor to the resizing cursor.

Step 3: Use the resizing cursor to drag the resizing handles until the dashed border outlines the size you want.

Step 4: Release the mouse button. The structure reappears in its new size.

When resizing a single frame in a Flat Sequence structure using the resizing handle on a shared edge of two frames, make sure you are resizing the correct frame by noting which frame displays resizing handles. To shrink a frame using the resizing handle on the left edge of a frame, drag the handle to the right. To grow a frame using the same resizing handle, drag the handle to the left. When you shrink or grow a frame, the other frames in the Flat Sequence structure remain their current size and move to adjust to the resized frame.

8.4.5 Adding Cases to the Middle of an Ordered List

Complete the following steps to add a case to the middle of the order of a Case structure and shift existing cases down in the order.

Step 1: Add a new case at the end of the order.

Step 2: With the new case visible, right-click the structure border and select Shift Diagram To

Case from the shortcut menu.

Step 3: Select the position for the new case. The subsequent subdiagrams shift down in the order.

You also can press the <Shift-Enter> keys in the case selector label to add a case to a Case structure.

8.4.6 Adding, Duplicating and Deleting Subdiagrams

Right-click a Case, Stacked Sequence, Flat Sequence, Conditional Disable, or Diagram Disable structure border and select Add Case (or Frame or Subdiagram) After or Before from the shortcut menu to add a subdiagram.

Complete the following steps to make a copy of the visible subdiagram in a Case, Stacked

Sequence, or Conditional Disable structure and insert it after the original subdiagram. Step 1: Move to the subdiagram you want to duplicate.

Step 2: Right-click the structure border and select Duplicate Case (or Frame or Subdiagram) from the shortcut menu. The duplicate subdiagram contains all objects from the original subdiagram except front panel terminals.

Step 3: If you are configuring a Conditional Disable structure, select a Symbol and enter a Value in the Configure Condition dialog box.

When you add, delete or rearrange frames in a Stacked Sequence structure, LabVIEW automatically adjusts the numbers in the frame labels. When you add or delete frames in a Flat

Sequence structure, the structure resizes automatically. You can rearrange the subdiagrams in a Case or Conditional Disable structure, but the order of the cases does not affect how the VI runs.

You also can add or duplicate event cases.

To delete the visible subdiagram, right-click the structure border and select Delete This Case (or Frame or Subdiagram) from the shortcut menu. If only one subdiagram exists, you cannot delete the visible subdiagram.

In document Virtual Instrumentation Using Labview (Page 188-190)