03-20-2017 05:41 PM
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.
03-20-2017 07:31 PM
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?
03-21-2017 03:16 AM
I have 3 GPIB and one USB and all 4 respond to IDN*?
03-21-2017 10:00 AM
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.
03-21-2017 01:12 PM
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