Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Library Handshaking over GPIB

I’m in the process of learning the VISA library and I have a question regarding handshaking. I’ve inherited some code that makes calls to viPrintf() and viScanf() and I’m encountering a latency issue when interacting with a Krohn-Hite 526  calibrator. For instance, when I run my code real-time, I have latency issues, but when debugging, the issue dissapears.Currently I’ve patched the issue by putting a 50ms delay inbetween the read and write, but for obvious reasons I’d like to eliminate it and patch it correctly. So my question is do the viPrintf() and viScanf() functions perform handshaking over GPIB/IEEE-488 or does that have to be done using other functions within the library? If anybody has some sample C code which performs the required handshaking, it would be greatly appreciated.

0 Kudos
Message 1 of 2
(4,550 Views)

@fpernice wrote:

I’m in the process of learning the VISA library and I have a question regarding handshaking. I’ve inherited some code that makes calls to viPrintf() and viScanf() and I’m encountering a latency issue when interacting with a Krohn-Hite 526  calibrator. For instance, when I run my code real-time, I have latency issues, but when debugging, the issue dissapears.Currently I’ve patched the issue by putting a 50ms delay inbetween the read and write, but for obvious reasons I’d like to eliminate it and patch it correctly. So my question is do the viPrintf() and viScanf() functions perform handshaking over GPIB/IEEE-488 or does that have to be done using other functions within the library? If anybody has some sample C code which performs the required handshaking, it would be greatly appreciated.


As I recall there is a function to change the VISA timeout value. Set that to a few seconds and your code will wait at the viScanf() before timing out and giving you an error.

0 Kudos
Message 2 of 2
(4,535 Views)