Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically detect GPIB equipment?

I have a program that takes a while to run using a spectrum analyzer. If for whatever reason something happens that causes the connectivity to the spectrum analyzer to be lost my program stops. I am trying to write an error/recovery program in this error state. I have it all but the last peice. To test this I am turning off my GPIB-ENET/100 controller or the spectrum analyzer. This causes my spectrum analyzer in my instrument I/O drop down list to not be present anymore. The only way I can recover this situation is to shutdown Labview and run the Scan for Instruments in MAX. I then start up Labview and the spectrum analyzer is available. Is there any way to programmatically run this routine that MAX does when scanning for instruments on the dedicated controller?
 
Thanks for any help.
 
Troy
0 Kudos
Message 1 of 5
(5,382 Views)
Hey Troy,
There is a way of running a scan for instruments using VISA commands. What it will do is find all the resources that are available and you can use that as a reference. The vi that is used to do this is under the functions palette->Instrument I/O->VISA->Advanced->VISA Find Resource. I've attached a picture of generally how things are set up using this function for this purpose.


Hope this helps




Message Edited by Can W on 11-12-2007 10:10 AM
Can Wong
Message 2 of 5
(5,353 Views)
Awesome, I will give this a try. I found the Find Resource VI that you referenced and got it to the point where it listed what resources I had available. I just did not know how to make it scan for those resources from that point. Thanks for the help.
 
Troy
0 Kudos
Message 3 of 5
(5,349 Views)
Can,
I am getting my list of equipment but I still cannot regain any equipment communication w/o shutting down Labview, running MAX scan for instruments and then restarting Labview. When I run the VI that you proposed it definitely gave me my list of aliases but the GPIB address in the probe indicates 0 when it should be 18. Is shutting down Labview and running MAX the only way to recover lost comm with GPIB?
 
Thanks,
Troy
0 Kudos
Message 4 of 5
(5,300 Views)
Hey Troy,
There are actually a whole slew of VIs that will scan for instruments on your bus, and initialize them if need be. You can access these VIs through the functions palette on the block diagram, under the Instrument I/O->GPIB->488.2 sub-directory, you should find the FindLstn, TestSys, and ResetSys. These three VIs should be able to find all devices on the bus, initialize them and perform a self test. I hope that this helps
Can Wong
0 Kudos
Message 5 of 5
(5,277 Views)