Upload
sheena-armstrong
View
212
Download
0
Embed Size (px)
Citation preview
Creating, Editing, & Debugging a VI
A. How to Create VIs
B. How to Edit VIs
C. How to Debug VIs
You Will Learn:
• Numeric controls and indicators• Boolean controls and indicators• Configuring controls and indicators
– Use shortcut menus– Parts have different menus
DigitalControl
DigitalIndicator
Labels
Increment Buttons Boolean
Control BooleanIndicator
Creating a VI Front Panel
Accessing Shortcut Menus
Right-click on the label for its shortcut menu Right-click on the digital
display for its shortcut menu
Terminal pattern for theAdd Function and theSubtract function (three node terminals).
NodesWires
ControlTerminals
Diagram Window
Panel Window
Indicator Terminals
Creating a VI Block Diagram
Wiring a VI Block Diagram
Hot Spot
Tools to Help Wiring
- Automatic Wiring
Scalar 1D Array
Numeric
Boolean
String
Orange (floating point)Blue ( integer)
Green
Purple
2D Array
• Block diagram does NOT execute left to right
• Node executes when data is available to ALL input terminals
• Nodes supply data to all output terminals when done
Dataflow Programming
Searching for Controls, VIs, and Functions
Use the buttons on top of the Controls and Functions palettes to navigate and search for specific controls, VIs, and functions.
Press the search button to perform text searches of the palettes.
Debugging Techniques
• Finding Errors
• Execution Highlighting
• Probe
Click on broken Run buttonWindow showing error appears
Click on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires.
Right-click on wire to display probe and it shows data as it flows through wire segment
You can also select Probe tool from Tools palette and click on wire
Debugging Techniques
• Breakpoints
• Step Into, Over, and Out buttons for Single Stepping
Click on Step Into button to enable single steppingOnce Single Stepping has begun, the button steps into nodes
Click on Step Over button to enable single stepping or to step over nodes
Click on Step Out button to step out of nodes
Select Breakpoint tool from Tools palette and click on wire or node where you want execution to pause
Summary
• You place controls (inputs) and indicators (outputs) in the panel window
• Use the Operating tool to manipulate panel objects. Use the Positioning tool to select, move, and resize panel objects. Use the Wiring tool to connect diagram objects
• Control terminals have thicker borders than indicator terminals
• All LabVIEW objects have shortcut menus
• Wiring is the mechanism to control dataflow and produce LabVIEW programs
• Broken Run arrow = nonexecutable VI
• Various debugging tools and options available such as setting probes and breakpoints, execution highlighting, and single stepping
Tips• Tip 1 – Command key shortcuts
• Tip 2 – Accessing Tools Palette with <shift>-right-click
• Tip 3 – Tools»Options selection - set preferences in LabVIEW
<Ctrl-R> Run a VI<Ctrl-F> Find object<Ctrl-H> Activate Context Help window<Ctrl-B> Remove all broken wires<Ctrl-W> Close the active window<Ctrl-E> Toggle between Diagram/Panel Window