Presentation is loading. Please wait.

Presentation is loading. Please wait.

EET 2259 Unit 3 Editing and Debugging VIs

Similar presentations


Presentation on theme: "EET 2259 Unit 3 Editing and Debugging VIs"— Presentation transcript:

1 EET 2259 Unit 3 Editing and Debugging VIs
Read Bishop, Chapter 3. Lab #3 and Homework #3 due next week. Quiz #2 next week. Handouts: Quiz #1.

2 Editing Techniques Editing techniques include
Creating controls & indicators on block diagram Selecting objects Moving objects Deleting objects Duplicating objects Resizing objects Labeling objects Changing text font, style, size, color Working with wires Aligning, distributing, and resizing objects Coloring objects Cleaning up the block diagram (Bishop, pp ) -A slide follows on each of these. -Have students start a blank VI in LabVIEW and follow along with each step.

3 Creating Controls & Indicators From the Block Diagram
After placing a function or subVI on block diagram, right-click on one of its terminals and select Create > Control or Create > Indicator. This adds a control or indicator to the front panel and automatically wires it on the block diagram. (Bishop, p. 112) -Tile windows side by side. -Demo by placing multiply function on block diagram, then Create Control on first input, then Create Constant (=5) on second input, and Create Indicator on output. Note control and indicator on front panel. -Then right-click and Replace control with a knob. Make its digital display visible, and change its representation to I8 instead of floating point.

4 Automatic Selection Tool
Tools Palette Lets you operate and modify objects on front panel or block diagram. Automatic Selection Tool Scrolling Tool Breakpoint Tool Probe Tool Color Copy Tool Coloring Tool Operating Tool Positioning/Resizing Tool Labeling Tool Wiring Tool Shortcut Menu Tool Generally best to use automatic tool selection, in which case you’ll rarely need to bring up this palette. (Bishop, p. 23)

5 Selecting Objects To move, delete, or copy an object on the front panel or block diagram, you must first select the object. The easiest way to select an object or objects is to drag a box around them. You can also select an object by clicking it with the positioning tool, and you can select multiple objects by shift-clicking. (Bishop, p. 114) -Using knob on front panel, show how selecting the knob also selects label and display, or you can select those items individually.

6 Moving Objects After selecting an object or objects, move by dragging with the mouse or using the arrow keys. (Bishop, p. 116) -Using knob on front panel, show how moving the knob also moves label and display, or you can move those items individually. -Demo on both front panel and block diagram.

7 Deleting Objects After selecting an object or objects, delete by pressing Delete or Backspace key, or by Edit > Clear on pull-down menus. (Bishop, p. 117) If you make a mistake, you can undo your last step by using Edit > Undo or pressing Ctrl+Z. -Demo.

8 Duplicating Objects After selecting an object or objects, duplicate by Edit > Copy and Edit > Paste on pull-down menus (or use Ctrl+C and Ctrl+V shortcut keys). (Bishop, p. 117) Demo on front panel and block diagram.

9 Resizing Objects To resize an object on the front panel, drag the blue resize handles that appear when you move the positioning tool over the object. Most block-diagram objects cannot be resized. (Bishop, p. 117) -Demo on front panel.

10 Labels There are two kinds of labels: free labels and owned labels.
Create a free label by using the labeling tool on the tools palette or by double-clicking on blank area of front panel or block diagram. Show or hide an object’s owned label by using short-cut menu’s Visible Items > Label. Edit any label by double-clicking. (Bishop, p. 119) -Demo by showing that you can put free labels on either the front panel or the block diagram. -Also you can show or hide a front panel item’s label independently of showing or hiding the label of the corresponding terminal on block diagram.

11 Changing Text Font, Style, Size, Color
Use the Text Settings drop-down box on the toolbar to change text appearance. (Similar to word processors.) You can change text appearance on the front panel or on the block diagram. (Bishop, p. 120) Demo.

12 Working with Wires (Bishop, pp. 122-127) Wiring “Hot Spot”
Click To Select Wires Clean Up Wiring (Bishop, pp )

13 Broken Wires Remove a single broken wire by selecting the wire and pressing the Delete key, or by right-clicking the wire and selecting Delete Wire Branch. Remove all broken wires by using Edit > Remove Broken Wires pull-down menu (or Ctrl+B shortcut key). (Bishop, p. 125) -Demo by deleting multiply function from block diagram.

14 Aligning, Distributing, and Resizing Objects
After selecting two or more front-panel objects, use buttons on the toolbar to align them with each other, space them evenly apart, or make them all the same size. (Bishop, p. 128) The block diagram’s toolbar has Align and Distribute buttons, but not a Resize button. Align Distribute Resize -Demo on front panel with two knobs and a gauge.

15 Coloring Objects Use the coloring tool on the Tools Palette to change colors of objects. For many front-panel objects, you can also change the color by choosing Properties on the object’s shortcut menu. (Bishop, p. 130) -Demo with knobs and gauge. It seems to me that foreground and background color swatches are reversed for some objects—may take some experimenting to get what you want. Show how with gauge you can independently color the face , the text labels, and the needle. -Also demo changing background color of entire front panel or block diagram.

16 Cleaning Up the Block Diagram
This feature will automatically rearrange your block diagram and reroute the wires to make everything look clean and well-ordered. On the block diagram pull-down menu, click Edit > Clean Up Diagram; or you can just press CTRL+U; or you can just click the Clean Up button: (Bishop, p. 137) Experienced LabVIEW uses tend not to use this a lot, since it may completely rearrange a block diagram that they have carefully organized—demo using Lab02ParallelCircuit. -Also mess up part of the diagram and then show how you can use it just to clean up the selected code.

17 Lab 3: The Boolean Data Type and Digital I/O
The Boolean data type goes hand-in-hand with digital I/O. In Lab 3 you’ll learn about a few new things: Front-panel items found in the Boolean sub-palette of the Controls palette.

18 Lab 3: The Boolean Data Type and Digital I/O (Cont’d.)
In Lab 3 you’ll learn about a few new things: Block-diagram items found in the Boolean sub-palette of the Functions palette.

19 Lab 3: The Boolean Data Type and Digital I/O (Cont’d.)
In Lab 3 you’ll learn about a few new things: Digital Input and Digital Output on the DAQ Assistant.

20 Lab 3: The Boolean Data Type and Digital I/O (Cont’d.)
In Lab 3 you’ll learn about a few new things: The DIO pins on the myDAQ.

21 Debugging Techniques Debugging techniques include
Using Broken Run button to find errors Execution highlighting Single-stepping Breakpoints Probes (Bishop, pp ) -A slide follows on each topic. -Use Bouncing Cube.vi to demo.

22 Broken Run Button When the block diagram contains an error that prevents the VI from running, the Broken Run button appears in place of the normal Run button. (Bishop, p. 142) -Demo by removing a wire going into one of the Height or Translation Multiply functions. Demo use of Show Error button. Click the Broken Run button to open window listing errors.

23 Execution Highlighting
To monitor the execution of the block diagram, click Highlight Execution button on block diagram’s toolbar and then run the VI. (Bishop, p. 144) -Demo by first replacing a Multiply with a Divide to break the program. Show how values appear at terminals as it executes. Click the Highlight Execution button; data flow is animated using bubbles. Values are displayed on wires.

24 Single-Stepping To execute block diagram one node at a time, use one of the single-stepping buttons on block diagram’s toolbar. (Bishop, p. 146) Step Into button executes current node. If current node is a subVI, its first step is executed. -Demo by pausing while it’s running (with Ex Highlighting on) and then single step a few steps. Step Over button executes current node. If current node is a subVI, entire subVI is executed. Step Out button executes until current subVI (or entire program) finishes.

25 Execution Highlighting and Single-Stepping
Usually when you single-step, you’ll also want to have execution highlighting turned on so that you can see the effect of each step. (Bishop, p. 146) Demo

26 Breakpoints Set a breakpoint in block diagram by using Breakpoint tool on tools palette or by right-clicking on an object. When you run VI, execution will stop when it reaches the breakpoint. (Bishop, p. 147) This is useful if you’ve got a long program and you want to let it run quickly up to a certain point and then you want to start single-stepping from that point forward. -Demo by inserting breakpoint at broken Mutiply.

27 Probes Place a probe in block diagram by using Probe tool on tools palette or by right-clicking on wire. When you run VI, window displays value at the point where the probe is placed. (Bishop, p. 148) This is useful if you don’t want to slow the entire program down with execution highlighting, but you want to see the value at a particular point. -Demo by inserting probe.

28 Property Nodes Property nodes are block-diagram objects that let you read or set the properties of front-panel objects. To create a property node, right-click a front-panel objects and then select Create > Property Node. (Bishop, p. 153) Property nodes are powerful, advanced features that will become more valuable to you as you gain more LabVIEW experience. -Demo by placing an LED and creating a Label Font Size property node. Then add two more elements to the property node and set them to Position Left and Visible. -First read the values, then change them all to write and connect them to constants. -Then replace the constants with controls that let the user change the properties. -We’ll use property nodes from time to time.

29 Some Shortcut Keys Ctrl+B removes broken wires.
Ctrl+E switches between front panel & block diagram. Ctrl+T tiles front panel & block diagram side by side. Ctrl+H turns help window on or off. Ctrl+U cleans up the block diagram. Plus standard Windows shortcuts: Ctrl+O to open file. Ctrl+S to save file. Ctrl+C to copy. Ctrl+V to paste. Ctrl+Z to undo (Bishop, p. 155)


Download ppt "EET 2259 Unit 3 Editing and Debugging VIs"

Similar presentations


Ads by Google