Data buffer vs realtime VDT2 read?

I am reading ASCII data sent from an Arduino into Igor using VDTReadWave2. This works great for the first call, but upon subsequent calls, it seems that the wave is populated instantaneously with data that I presume is old and stored in the buffer. I have made the buffer smaller (from 1000 to minimum 32) in order to reduce the amount of data stored and speed the link between incoming serial port data and wave population, but it that didn't seem to change very much. (On Windows 7 machine, Igor V 6.3)
My questions are:
1. Do you think that this sounds like a buffer problem and if so...
2. is it possible to clear the buffer within Igor between calls? And if so, how? (since I'm just using very dumb terminal read, I'm not writing anything to the Arduino, so I don't think I need to clear the buffered data from there.)
3. Eventually I would like to be able to update the wave continuously in a realtime data acquisition mode while plotting it. Will the calls like VDTReadWave2 work for this kind of application? I am generally confused about the relationship between buffer size and the time it takes to get new data into a usable form (like in a wave) and I want to minimize the delay.
Thanks and sorry if this is a bit garbled. I'm new to serial IO, so if these questions make any sense, the more info you can provide the more I can work to help myself!
-ap
Quote:
I have made the buffer smaller (from 1000 to minimum 32) in order to reduce the amount of data stored


The buffer size setting depends on support from the serial driver or OS, I'm not sure which, and I believe that it is usually not supported and does nothing.

Quote:
Do you think that this sounds like a buffer problem and if so

The most straight-forward explanation is that the arduino keeps sending data and it gets buffered. Normally this is what you want as it prevents dropping data.

If you want to drop data then you would normally do a VDTReadBinary2 call to read the number of bytes you want to drop. But it sounds like you want to drop all data that may have accumulated, though I'm not sure why.

Quote:
is it possible to clear the buffer within Igor between calls?


Yes. Execute "VDT2 killio".

Quote:
Eventually I would like to be able to update the wave continuously in a realtime data acquisition mode while plotting it. Will the calls like VDTReadWave2 work for this kind of application?


It will work so long as you can read the data before it overflows the buffer. This depends on the rate at which data is coming in, what you are doing in Igor, and what the OS is doing. It is likely to work only for pretty-slow data rates - perhaps 100 Hz.

If you want to use Igor while data is being acquired then you need to use a background task. This is more difficult programming and you should not attempt it until you get it working from a simple user-defined function tight loop.

Quote:
I am generally confused about the relationship between buffer size and the time it takes to get new data into a usable form (like in a wave) and I want to minimize the delay.


The buffer size has nothing to do with the time it takes to get data. It only relates to what happens if the device is sending data faster than you can read it. Either it gets buffered or it gets dropped. In the latter case, usually, your receiving software gets out-of-sync with the sending software and winds up waiting for data that never arrives. Then it hangs unless you use a timeout via the /O flag.