Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB how to avoid timeout , when reading emptry string

Hi,

 

I am doing a gpib.read() . Sometimes when there is no data on the spectrum analyzer and I do a read() command I get a timeout. I know the reason why I get the time out b/c the pc is waiting for the data, but the data does not exist.

 

-How do I tell the system that there is no data coming do not timeout,but continue on with the code?

0 Kudos
Message 1 of 2
(3,123 Views)

The timeout that is returning is and error, and in order to continue on with the code you would just need to handle the error.  This is different for every language so I would suggest reading about how to handle error in the language you are programming.

Jensen
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(3,110 Views)