cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Use VISA to find descriptors of all instruments attached to PC

Highlighted

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
(324 Views)

Re: Use VISA to find descriptors of all instruments attached to PC

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
(293 Views)

Re: Use VISA to find descriptors of all instruments attached to PC

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

0 Kudos
Message 3 of 5
(269 Views)

Re: Use VISA to find descriptors of all instruments attached to PC

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. 

 

 

0 Kudos
Message 4 of 5
(254 Views)

Re: Use VISA to find descriptors of all instruments attached to PC

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
(247 Views)