Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 36 ยท Debugging and Testing

Debugging Tools: Probes and Highlight Execution

Find bugs in LabVIEW VIs with execution highlighting, probes, breakpoints, single-stepping, conditional probes and the broken-run-arrow error list, plus common dataflow bugs.

LabVIEW's graphical dataflow makes many bugs visible, but a wire that carries the wrong value looks just like one that carries the right one. The IDE therefore has debugging tools that let you watch data move. This lesson walks through them in the order you normally reach for them. Because LabVIEW cannot run on this site, the steps are described in words, and a Python stand-in shows the same techniques on small code.

First: why is the Run arrow broken?

A broken Run arrow means the VI cannot compile. Click it (or choose View > Error List) to open the Error list window, which lists each problem; double-click an item to jump to the offending object. Frequent causes:

  • A required input terminal on a subVI is unwired (shown with a red dot).
  • A wire has a broken (dashed) shape: mismatched data types or a loose end. Right-click the wire and choose Clean Up Wire, or press Ctrl+B to delete all broken wires.
  • A subVI itself is broken, or a missing/renamed file turned it into a question-mark placeholder.
  • A tunnel or output of a structure is not assigned on all cases of a Case structure.
  • A control and indicator with the same name conflict in a typedef.

A warning (yellow triangle) does not stop running but should be read, for example an unused value.

Execution highlighting

Click the light bulb (Highlight Execution) on the block diagram toolbar. Run the VI and LabVIEW slows down and shows data as bubbles moving along the wires. Highlighting is the fastest way to see order and branches: which case ran, how many loop iterations happened, which wire never got data. It makes the VI run extremely slowly, so use it with small inputs or combine it with a breakpoint to start near the problem.

Retain Wire Values (the bulb with a small number) keeps the last value on every wire after a run, so you can hover or probe any wire afterwards without re-running.

Single-stepping

The toolbar has three step buttons:

  • Step Into (Ctrl+Down): execute the next node and, if it is a subVI or structure, enter it.
  • Step Over (Ctrl+Right): run the next node in full.
  • Step Out (Ctrl+Up): finish the current subVI or structure.

When you pause, the node about to run blinks. Pressing Pause during a run stops at the next node in the executing VI; pressing it again resumes.

Probes

A probe shows a wire's value live. Right-click a wire and choose Probe, or use the Probe tool from the Tools palette. Variants:

Probe Use
Generic probe Shows the value of any wire with a built-in indicator; one window per probe
Custom probe A VI you design that shows what you need (for example, only waveform peaks)
Conditional probe Pauses execution only when a condition is true (for example, value > 5)
Watch window Collects several probes in one list; shows each value and its history

Right-click a wire and Custom Probe > New to create a probe VI with its own indicator. Place conditional probes inside loops to stop on the iteration you care about instead of stepping through hundreds.

Breakpoints

Choose the Breakpoint tool and click a node or wire to place a red outline or dot. When execution reaches it the VI pauses. A breakpoint on a subVI call with Pause on call stops as the subVI starts, so you can inspect its inputs. You can also set Suspend When Called in VI Properties > Execution to pause every call. Remember to clear breakpoints before building (Operate > Clear All Breakpoints or Edit > Remove Breakpoints from All VIs).

Common dataflow bugs

  • Race conditions: two parallel branches that use the same local variable or file. The fix is an explicit ordering wire (the error cluster) or removing the shared state.
  • Uninitialised shift registers: they keep the value of the previous run of a VI (not just iteration), so a total that "starts from 0" begins with last run's result. Initialise every shift register.
  • Wrong loop count: a For Loop with an empty array runs zero times and outputs defaults; wire N explicitly when that is not what you want.
  • Auto-indexing surprises: wiring an array into a loop auto-indexes it (one element per iteration); disable the tunnel when you need the whole array.
  • Coercion dots (small red dots at terminals) show an implicit type conversion, such as a double to an integer that truncates.
  • Default case taken: a Case structure sends a wrong value to the default; print the selector value.

Stand-in: tracing and conditional breaks in code

LabVIEW probes correspond to printing a value at a point; a conditional probe is a guarded stop. This Python example finds the loop iteration where a running total first exceeds a limit (the one a conditional probe would stop on), and shows the uninitialised shift register mistake as state kept from "the last run".

Python Tracing like a probe (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A debugging routine

  1. Read the error list and fix broken wires first.
  2. Turn on highlight execution with a small input to see the path.
  3. Add probes on suspicious wires; use conditional probes inside loops.
  4. Break at the call of the subVI you suspect and step into it.
  5. Check the error cluster at each stage, a failing VI upstream often causes a confusing symptom downstream (see error handling).
  6. When fixed, write a test that would have caught it.

Make debugging easier in advance: give every wire and subVI a sensible name, use the Clean Up Diagram tool, keep VIs small enough to see at once, and put error clusters on all subVIs.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Where do you find out why the Run arrow is broken?

    Click the broken arrow or use View > Error List to see each problem.
  2. 2. What does a conditional probe do?

    It is ideal inside loops where you only care about one iteration.
  3. 3. A running total starts at the previous run's final value. What is the most likely cause?

    Shift registers keep their values between runs unless the initial value is wired.
  4. 4. Which button runs a subVI to completion in one step?

    Step Over executes the next node, including a subVI, in a single step.

Summary

  • Fix broken wires with the Error List, then use highlight execution to see dataflow.
  • Probes, conditional probes and the Watch window inspect values; breakpoints and step buttons control execution.
  • Typical bugs: uninitialised shift registers, races, auto-indexing and silent defaults.
  • Debug in a routine and finish by adding a test.

Next: Error Handling and Error Clusters