Debugging Tools in LabVIEW
Debugging Tools in LabVIEW
Print
Included in the Section
Fixing Broken VIs
Finding Causes for Broken VIs
Common Causes of Broken VIs
Fixing Incorrect Behavior
Block Diagram Toolbar
Probe Tool
LabVIEW software contains powerful debugging tools to help you identify problem areas in your code so you can
make the appropriate changes. You may encounter two general types of software bugs: those that prevent the
program from running and those that generate bad results or incorrect behavior. This module teaches you how to
identify and troubleshoot both types of errors.
If LabVIEW cannot run your VI, it informs you by changing the run arrow to a broken icon, and the Error List window
lists the specific reasons why the VI is broken. The second type of bug is typically harder to track down, but LabVIEW
has several tools you can use to watch your code as it executes, which makes the process much easier.
If a VI does not run, it is a broken, or nonexecutable, VI. The Run button appears broken when the VI you are
creating or editing contains errors.
Generally, this means that a required input is not wired, or a wire is broken. Press the broken Run button to access
the Error List window. The Error List window lists each error and describes the problem. You can double-click an
error to go directly to the error.
Click the Highlight Execution button to display an animation of the block diagram execution when you run the VI.
Notice the flow of data through the block diagram. Click the button again to disable execution highlighting.
Execution highlighting shows the movement of data on the block diagram from one node to another using bubbles
that move along the wires. Use execution highlighting with single-stepping to see how data values move from node to
node through a VI.
Note: Execution highlighting greatly reduces the speed at which the VI runs.
Figure 2. Example of Execution Highlighting in Use
Click the Retain Wire Values button to save the wire values at each point in the flow of execution so that when you
place a probe on the wire you can immediately retain the most recent value of the data that passed through the wire.
You must successfully run the VI at least once before you can retain the wire values.
Click the Step Into button to open a node and pause. When you click the Step Into button again, it executes the first
action and pauses at the next action of the subVI or structure. You also can press the <Ctrl> and down arrow keys.
Single-stepping through a VI steps through the VI node by node. Each node blinks to denote when it is ready to
execute.
Click the Step Over button to execute a node and pause at the next node. You also can press the <Ctrl> and right
arrow keys. By stepping over the node, you execute the node without single-stepping through the node.
Click the Step Out button to finish executing the current node and pause. When the VI finishes executing, the Step
Out button is dimmed. You also can press the <Ctrl> and up arrow keys. By stepping out of a node, you complete
single-stepping through the node and navigate to the next node.
The Warning button appears if a VI includes a warning and you placed a checkmark in the Show Warnings checkbox
in the Error List window. A warning indicates a potential problem with the block diagram, but it does not stop the VI
from running.
Probe Tool
Back to top