Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB serial poll (SPOLL) responses appear to be queued

I seem to be having a problem which I believe is related to a configuration setting.  I have two identical systems running under NI-VISA.  I use the VIC interface and send out a few commands/queries and then follow up with a *CLS (to clear the instrument SPOLL register).  If I then SPOLL the instrument, there are multiple stale SPOLL responses (on one system but not the other).  This happens on more than one piece of equipment.  I noticed that both systems have autopoll enabled and that if I disable the autopoll, the problem goes away.  While this may 'solve' the problem I would like to know if there is some setting that would be causing this behavior so I know how to properly configure future systems.
 
Thanks!
0 Kudos
Message 1 of 3
(4,396 Views)
In NI-488.2 help (under Start, Programs, NI-488.2, NI-488.2 Help), see the topic "Automatic Serial Polling Overview".  VISA leave the autopolling setting the same as you left it in the MAX properties of the GPIB board when you open a instrument handle on that board (so if Autopolling is turned on in MAX, it'll be on when you open a VISA session too).  VISA will change the autopolling setting to TRUE if you do something that makes it need Autopolling, such as doing an viWaitOnEvent for the RQS event, or a viNotify for the RQS event.
 
You can handle the issue a few different ways.  If you never use the RQS event, then you can disable Autopolling in MAX and it'll never queue serial poll responses.  If you sometimes use autopolling, you can clear your instrument by doing a CLS and then doing viReadSTB's until you get a non-positive response to the function (bit 6 isn't set).  This means that you have cleared out the autopoll queue and any future serial polls you request actually generate a "true" serial poll on the bus rather than pulling it from the queue.
 
Hope this helps.  Autopolling is tricky but necessary for certain functionality.
 
Scott B.
GPIB SW
National Instruments
Message 2 of 3
(4,390 Views)
Thanks for the info - was very helpful!
0 Kudos
Message 3 of 3
(4,386 Views)