Inside Collection (Textbook): LabVIEW Graphical Programming
Summary: Practice debugging techniques.
Complete the following steps to load a broken VI and correct the error. Use single-stepping and execution highlighting to step through the VI.
Window>>Show Block Diagram to display
the block diagram shown in Figure 2.
![]() |
The Random Number (0-1) function, located on
the Functions>>Arithmetic & Comparison>>Express
Numeric palette, produces a random number between
The Multiply function, located on the
Functions>>Arithmetic & Comparison>>Express
Numeric palette, multiplies the random number by
The numeric constant, located on the
Functions>>Arithmetic & Comparison>>Express
Numeric palette, is the number to multiply by the
random number.
The
Debug Exercise (Sub) VI, located in the
C:\Exercises\ LabVIEW Basics I directory, adds
Run button to display the
Error list window, which lists all the
errors.
Error
list window. The Details section
describes the error and in some cases recommends how to
correct the error.
Help button to display a topic in
the LabVIEW Help that describes the error
in detail and includes step-by-step instructions for
correcting the error.
Show Error button or double-click
the error description to highlight the area on the block
diagram that contains the error.
Error list window to fix each error.
File>>Save to save the VI.
Window>>Show Front Panel.
Run button to run the VI several times.
Window>>Show Block Diagram to display
the block diagram.
Click the
Highlight Execution button, shown in Media 8, on the toolbar to enable execution
highlighting.
Click the Step Into button, shown in Media 9, to start single-stepping. Execution
highlighting shows the movement of data on the block
diagram from one node to another using bubbles that move
along the wires. Nodes blink to indicate they are ready
to execute.
Click the Step Over button, shown in Media 10, after each node to step through the
entire block diagram. Each time you click the Step
Over button, the current node executes and pauses
at the next node.
Data appear on the front panel as you step through the
VI. The VI generates a random number and multiplies it
by
When a blinking border surrounds the entire block
diagram, click the Step Out button, shown
in Media 11, to stop single-stepping through
the Debug Exercise (Main) VI.
Step Into button to start
single-stepping.
When the
Debug Exercise (Sub) VI blinks, click the
Step Into button. Notice the run button on
the subVI.
Display the Debug
Exercise (Main) VI block diagram by clicking
it. A green glyph, shown in Media 13, appears
on the subVI icon on the Debug Exercise
(Main) VI block diagram, indicating that the
subVI is running.
Debug Exercise (Sub) VI block
diagram by clicking it.
Step Out button twice to finish
single-stepping through the subVI block diagram. The
Debug Exercise (Main) VI block diagram is
active.
Step Out button to stop
single-stepping.
Use
the Probe tool, shown Media 14,
to click any wire. A window similar to Figure 3 appears.
![]() |
Probe window
automatically and displays the same number in a glyph on
the wire you clicked.
Probe
window displays data passed along the wire.
Use the Breakpoint tool, shown in Media 16, to click nodes or wires. Place a
breakpoint on the block diagram to pause execution after
all nodes on the block diagram execute.
Run button to run the VI. When
you reach a breakpoint during execution, the VI pauses
and the Pause button on the toolbar appears
red.
Click
the Continue button, shown Media 17, to continue running to the next
breakpoint or until the VI finishes running.
Breakpoint tool to click the
breakpoints you set and remove them.
Highlight Execution button to disable
execution highlighting.
File>>Close to close the VI and all open
windows.
"A full introductory course on programming with LabVIEW."