From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use VISA to find descriptors of all instruments attached to PC

I'm trying to find all of the instruments connected to my PC. Most of the info on VISA was written when the error wire for VIs were still magenta. I tried using the VISA find instruments and then opening a VISA session to the instrument and then getting the descriptor. I get an error -1073807339 [VISA Read in Inst Discover.vi] when trying to open any of the found instruments. Seems strange that there is no examples that shows how to do this simple but important task.

 

I want to avoid having a user use a drop down box so select a VISA resource name.

0 Kudos
Message 1 of 5
(3,040 Views)

Do you know if all the instruments will respond to IDN?

 

Your VI doesn't establish any serial parameters like baud rate, data bits, stop bits, or parity.  It will use either VISA MAX values or Windows device manager values as default.  Do you know if your devices' settings match those defaults?

0 Kudos
Message 2 of 5
(3,009 Views)

I have 3 GPIB and one USB and all 4 respond to IDN*?

0 Kudos
Message 3 of 5
(2,985 Views)

Ravens Fan brings up some good points. I too have wondered down the rabbit hole of wanting LabVIEW to find multiple instruments and figure out where they are located so the end user does not have to every time. 

 

For individual test programs, I have found that it makes more sense to simply save the VISA resources in a text file and then load those resources next time and check to see if the instruments are still there.


For my large ATE systems I use an XML configuration file to hold all the VISA resources and instrument parameters. 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(2,970 Views)

I added some debug code to expose the errors that are thrown. I made the mistake of copying the query command from NI-MAX that didn't contain a terminator. I fixed that. Then I threw in the DAQmx devices as well. All the default values are from my test system. Nice that it now works for GPIB, USB, and Ethernet devices. It will only find the internet devices added in NI-MAX.

Norm

0 Kudos
Message 5 of 5
(2,963 Views)