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.
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?
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.
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.