02-21-2014 05:50 PM
Config:
NI USB-GPIB-HS on Win 7 SP1.
VISA32.dll
talking to an HP8164A
Issue:
Unpredictable timeouts and then lock up on a viWrite() call. I had a large program that was stopping after various calls to viWrite() so I made a simple program that simply does the follwoing over and over again (NI I/O Trace shown):
viWrite (GPIB0::20 (0x020653F0), "*IDN?..", 7, 7)
viRead (GPIB0::20 (0x020653F0), "HEWLETT-PACKARD,HP816...", 20480, 48)
This will work for an unpredicatable number of times a then timeout on the viWrite() call with fewer than the 7 bytes returned. Once it times out the instrument locks up and I can't get it to respond to further viWrites() (i.e. times out with 0 bytes returned). The only way I can get the instrument back to operation is to restart it, which is very painful and basically makes the application unusable.
Does anyone know how to troubleshoot this problem? Is there something I need to do after the viWrite() timeout to make the instrument responsive again? I could handle the error condition in my code if I could get the instrument to respond again.
02-24-2014 07:33 AM
There are a few things to start with:
#1 Do you have the latest VISA driver?
#2 Did you tried to use the same code on another instrument (to isolate HW from SW)?
#3 Did you connected this instrument on another workstation and run the code from there?
02-24-2014 12:55 PM
#1 Yes I have the latest driver
#2 Just tried it connected to a different instrument and exact same code works perfectly, no lock-up, tens of thousands of cycles. This suggests an issue with the instrument. I have checked the connectors and I don't see any obvious issue, but the NI connector in general does seem a little looser than the typical GPIB cable.
#3 Didn't try that, based on the good results from #2
Interestingly enough, when locked up, it will still switch from manual to remote mode, just won't respond to the viWrite() commands. Is there some kind of reset you have to call after a timeout in order to get things working again?
02-25-2014 07:15 AM
Just by looking at your second answer, this seems like a problem with the instrument itself…
Specifically for timeouts, the following links might be worth taking a look:
Default Timeout for VISA Read and Write Vis
http://digital.ni.com/public.nsf/allkb/E4F90AD24DEC9CC786256F4300605C02
Timeout Errors
http://www.ni.com/support/labview/visa/verr2.htm
Why Do I Receive Timeout Error -1073807339 on VISA Read or Write?
http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0
02-25-2014 10:29 AM
Unfortunately longer timeout delay and delay between successive calls did not seem to help the problem at all.
02-26-2014 07:13 AM
At this point I would suggest replacing the HP8164A, since everything points to either a HW/configuration problem; or check with the manufacturer of that instrument.
03-03-2014 04:56 PM
Replacing the unit fixed the problem. Thanks.