Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is VISA (Using GPIB) Multithread-Safe?

For examples, if my programme contains 2 threads that send data via GPIB. If they do so as the same time, will it cause problem? or will VISA able to handle it?
0 Kudos
Message 1 of 2
(3,806 Views)
Yes, NI-VISA and (just as importantly) NI-488 are multi-threaded safe. I put them together here because NI-VISA communicates with GPIB instruments by calling into NI-488.

The only thing you need to be aware of is if you are doing asynchronous I/O. This prevents any other GPIB call on the same bus while the asynchronous I/O is in progress. This is due to the nature of the bus.

But if you are doing this from LabVIEW, or if you are using the normal synchronous viWrite/viRead C calls, then you will have no problem with this. Each call will block as appropriate. For example, 2 calls that use 2 different GPIB boards can enter the driver simultaneously. But if 2 calls that use the same GPIB board enter the driver at roughly the same time, then the fir
st call goes through, and the second call automatically blocks until the first completes. Your code never knows the difference.

Dan Mondrik
National Instruments
Message 2 of 2
(3,806 Views)