Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read of zero bytes causes timeout error

Problem did not occur with VISA version installed from LV5.1.1 CD, but occurs with LabVIEW 5.1.1 and VISA 2.6.

Reading zero bytes from the serial port occurs right after the port is initialized or just before a message is expected from the port. Flush buffer was not used in the code since it didn't work in VISA 2.5.

No problem with LabVIEW 6i and VISA 2.6
0 Kudos
Message 1 of 2
(3,136 Views)
You have found an interesting bug in NI-VISA 2.6. We will fix it in the next version. For now, there are a couple of possible workarounds I'd recommend.

The error only happens on asynchronous I/O with a byte count of 0. So if you make the read synchronous this should not happen. There is a known INI setting in LabVIEW 5x you can use to force VISA to use synchronous I/O.

Another workaround is for you to check the number of bytes before calling VISA Read. I presume you are using the output of the property that tells you the number of bytes available. When that is 0, just do not call VISA Read.

Hope this helps,
Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 2 of 2
(3,136 Views)