Reference Error When Using Event Structure in LabVIEW

Updated Jun 24, 2026

Reported In

Software

  • LabVIEW

Issue Details

  • I am using an Event Structure in a LabVIEW program. I perform file operations in the program, and Error 1 occurs when the program stops.
  • I use VISA functions to send commands only when events occur, and a reference-related error appears when the program exits.

Solution

This issue can occur when the Event Structure does not properly wire references through its output tunnels, causing default values to be used.
 
The following image shows an example where the output tunnel is set to use the default value:

To avoid errors, wire all output tunnels explicitly in every event case.

 

Note the difference compared to a Case Structure:

In a Case Structure, all output tunnels must be wired in every case for the VI to run. In an Event Structure, unwired tunnels are allowed and automatically use default values. While this allows the program to execute, it can result in invalid references and lead to errors when the program terminates.