05-25-2011 02:25 PM
I have a piece of hardware I am controlling using both a GUI and knobs/dials/buttons on the instrument itself.
Every time I change something manually, the instrument generates data and sends it to the port. I have no interest in every collecting this data.
When I want to write something to the port, prior to calling VISA write.vi, I use the attached subVI to flush the data at the port.
If I have done too much manually since my last VISA write command, the VISA read command in the attached subVI throws an overflow error (-107380252), which I am assuming means there are more than 4096 bytes (buffer size set at port initialization) at the port.
Am I right about that?
Is there a better way to flush the port that won't complain if there is too much at the port?
Do I need to just flush the port every so often so that it can't get too full (I would really prefer NOT to have to do this because it seems like it would add a bunch of overhead)?
Solved! Go to Solution.
05-25-2011 02:45 PM
Can you pls post the code in 8.6,
Check this option , initialize your VISA, use bytes at port and wire it to VISA read this will read all the pending data in buffer, you can flush the buffer now and then write the command using VISA write . Try this.
05-25-2011 02:52 PM
@systemcrash wrote:
Can you pls post the code in 8.6,
Check this option , initialize your VISA, use bytes at port and wire it to VISA read this will read all the pending data in buffer, you can flush the buffer now and then write the command using VISA write . Try this.
This is essentially what the posted subVI does, and I get the overflow error if there are more bytes at the port than the buffer size.
8.6 version attached
05-25-2011 03:21 PM
05-26-2011 10:06 AM
If there is too much data waiting at the instrument port, the READ in the attached subVI throws an overflow error.
I replaced this entire subVI with VISA Clear.
Works great.
Matt