Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Mixing sync and async GPIB I/O

What are the consequences, if any, of configuring some GPIB or VISA functions as synchronous I/O or asynchronous I/O for the same instrument?
 
For example, if the app's Initialze function uses synchronous I/O and the data query function uses asynchronous I/O.
 
Or for applications which support two or more instruments, does it matter if GPIB or VISA calls for one instrument uses synchronous I/O while the other instrument uses asynchronous I/O?  What if the two data query functions are running in parallel threads, one with synchronous the other with asynchronous I/O?
0 Kudos
Message 1 of 2
(2,852 Views)

With respect to the GPIB driver (NI-488.2), I don't see this being a problem from a technical standpoint, but you'll want to trap certain conditions in your code so that all goes through okay.  Your synchronous call may get blocked if there's an asynchronous one pending to the same bus or instrument, but this should work okay.  For example, if you do a "ibwrta" then an "ibrd" without doing an ibwait to resynchronize the driver, the ibrd will return EOIP meaning that IO is in progress and that call will need to be resubmitted once the driver is resynchronized.  See the NI-488.2 help for IBWRTA, IBRDA and the EOIP error for more information.

Scott B.
GPIB Software
National Instruments

0 Kudos
Message 2 of 2
(2,842 Views)