10-25-2010 02:02 PM
i have some GPIB replies that are "off" by one message when I get an gpib read error ...
list of events:
GPIB query #1
GPIB reply #1
GPIB query #2
read error
viFlush
GPIB query #3
GPIB reply #2 //should be reply #3
GPIB query #4
GPIB reply #3 // should be reply #4
Should I be using viClear instead of viFlush?
Thanks.
10-26-2010 12:50 AM
viFlush ensures that commands that are still in a write queue are written out. So it makes only sense if you use it before trying to read the response. If your read error is a timeout error it would also make sense trying to increase that timeout. viClear clears the devices GPIB controler. That probably also achieves that you are "in sync" again because it deletes the outstanding response for query #2.