How to Check if Data is Ready to be Read through VISA

Updated Apr 19, 2024

Environment

Software

  • LabVIEW

Driver

  • NI-VISA

This article explains how to ensure that your data is ready at the serial port before your program starts reading the data using the VISA Read function.

You can use the VISA Bytes at Serial Port property to check the number of bytes in the input buffer of the specified serial port. 

You can create a VISA Property Node from the function palette by selecting Instrument I/O >> VISA >> Advanced >> VISA Property Node. Click on the property, then select Serial Settings >> Number of Bytes at Serial Port.
Bytes at Port 2.PNG

Once the number of bytes at the serial port is greater than zero, it indicates that there is incoming data in the input buffer of that respective serial port and it is ready to be read.

Bytes at Serial Port.png

Next Steps

You can ensure that your data is captured completely by using Termination Character or specifying the byte count of the VISA Read function.