Programmatically Determine Available VISA Resources at Runtime in LabVIEW

Updated Apr 19, 2024

Reported In

Software

  • LabVIEW

Driver

  • NI-VISA

Issue Details

In my LabVIEW application, I would like to programmatically determine which VISA resources are present on my system at runtime.

Solution

The VISA Find Resources VI can be used in conjunction with a VISA Property Node and For Loop to programmatically search the available resources. To do this, follow the steps below:
  1. Open the functions palette and  navigate to Instrument I/O»VISA»Advanced and place a VISA Find Resource VI on the block diagram to output a string array of available resources.
  2. Insert a For Loop and wire the output of VISA Find Resource to the left border.
  3. Open the functions palette and navigate to Instrument I/O»VISA»Advanced and place a VISA Open VI within the For Loop.
  4. Connect the VISA resource name out output of VISA Open to the reference input of a VISA Property Node.
  5. Left-click the property node and select Interface Information»Interface Type.
  6. Wire the output of the VISA Property Node Intf Type to the edge of the For Loop.
  7. Right-click the output on the For Loop and select Create»Indicator.
  8. The VI shown below searches for all available resources and displays the interface type information. Interface types and their corresponding numbers can be found in the NI-VISA Help
Note: VISA Find Resource will not output resources currently in use by other applications.