Deiphos
2007-06-08 09:10:09 UTC
Hi!
I'm using a device that send a data each second, but I only want to check it about each half an hour, so I had the problem that I should flush the buffer to receive acualliced data and not old ones. And this is the problem. I have tried everything (I think) to clear the buffer: VISA Clear and VISA Flush I/O buffer didn't work at all, and finally I have tried something I red on this forum. Sorry, I haven't been able to find it again but more or less it was something like this:(see attached file).Basically, it consists on read all data stored on the buffer since it is empty. Then, I use a bit more than a second to re-fill buffer with a new data, and then I read and store this new data on a file (This last part is not displayed on the picture). The problem is that when I open the file containing data, I find that there is not only one data on it, there are the last 8 or 9 ones. I have also tried to do it without the waiting time but it does the same, what, I think, demonstrates that buffer isn't been flushed.
Any idea?
Thanks for all
loop.jpg:
Loading Image...
I'm using a device that send a data each second, but I only want to check it about each half an hour, so I had the problem that I should flush the buffer to receive acualliced data and not old ones. And this is the problem. I have tried everything (I think) to clear the buffer: VISA Clear and VISA Flush I/O buffer didn't work at all, and finally I have tried something I red on this forum. Sorry, I haven't been able to find it again but more or less it was something like this:(see attached file).Basically, it consists on read all data stored on the buffer since it is empty. Then, I use a bit more than a second to re-fill buffer with a new data, and then I read and store this new data on a file (This last part is not displayed on the picture). The problem is that when I open the file containing data, I find that there is not only one data on it, there are the last 8 or 9 ones. I have also tried to do it without the waiting time but it does the same, what, I think, demonstrates that buffer isn't been flushed.
Any idea?
Thanks for all
loop.jpg:
Loading Image...