01-16-2014 10:20 AM
I'm writting a driver for a Rigol oscilloscope using VISA with the USB port (scope firmware supports VISA).
How can you determine how many bytes are waiting to be read?
With the Visa-serial I can use "Number of bytes at serial port" but I can't find the equivalent for "plain" VISA.
I'm using a very high byte count with the VISA read vi to make sure I'm getting the full response but this seems a bit of a kludge.
So far the only way I can find is to catch the timeout error when no data is available.
01-16-2014 10:29 AM
01-16-2014 10:45 AM
As has been said, using the Termination Character to end the VISA read is by far the best way to go. But if you are dealing with binary data, this can cause a hichup if the termination character just happens to match a byte in the raw data.
01-16-2014 11:11 AM