06-23-2014 08:00 AM - edited 06-23-2014 08:09 AM
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.
06-23-2014 09:31 AM
@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.