LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting GPIB Error 1240--Wait for Interruppt

I'm using LabVIEW to control three different GPIB Instruments simultaneously (a Delta Design Oven, HP34401a Multimeter, and a HP 4140b pA-meter). I get an intermittent error when I read a block of data from the pA-meter. The error report says it's error 1240--wait for interrupt. Sometimes the program will run fine with no errors, but most of the time It'll read a few data points from the pA-meter and then generate an error.

The sub-VI that generates the error is a driver VI for the HP4140b called "Wait For Interrupt (GPIB)". That VI is within the while loop that reads successive data points from the HP4140b. Also, within the same while loop that has the VI that generates an error, I have a VI that reads from a differ
ent GPIB instrument--the multimeter. So I'm wondering if I am causing an intermittent conflict by trying to read from two different GPIB instruments from within the same while loop�that may be why the program runs fine sometimes but generates an error other times. Could that be the problem, or perhaps something else?
0 Kudos
Message 1 of 4
(3,450 Views)
I took a look at the Wait for Interrupt (GPIB).vi. The error you are seeing only occurs if there was an error before you called this VI. If you take a look at the block diagram, there is a Case Structure which checks to see if an error has already occured. If it has, then it reports the error that you are seeing. Try running your VI with a probe on the incoming error line and find out what type of error it is reporting. Also, go ahead and try this with only one instrument to see if that is the problem. Try it with each one individually to try and narrow down with instrument is causing the error or if it is only a combination of them.
J.R. Allen
0 Kudos
Message 2 of 4
(3,450 Views)
Actually I looked at Wait for Interrupt (GPIB) VI also. On the contrary, if there IS already an error, the Wait for Interrupt (GPIB) VI doesn't do anything. The case structure FALSE pane contains the code that throws the "1240" error. In the LabVIEW generic error clusters, a false Boolean indicates no error while true Boolean indicates that there is an error. So the Wait for Interrupt (GPIB) VI doesn't throw an error if there already was one, it simply passes the previous error through it. A "1240" error occurs--for whatever reason that I'm not sure of yet--only if an error did NOT occur previously.

So the question is now, referring to the case structure false pane in the Wait for Interrupt (GPIB) VI : What does it mean when the "poll response byte"
is less than zero, why is it happening intermittently, and what do I have to do to keep it from being less than zero?
0 Kudos
Message 3 of 4
(3,450 Views)
Hi,

Wait for GPIB SRQ will return -1 if the instrument does not respond within the specified timeout.

You could try increasing the timeout value used to allow the instrument more time to process.

DiegoF
National Instruments
0 Kudos
Message 4 of 4
(3,450 Views)