LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous data waveform graph using VISA

Hi
 
here is the question. 
 
I have got continous 8 bits data coming in from my FTDI chip using VCP via VISA. The device wont be closed unless the while loop has been terminated coz i dont wanna loose any data.
 
From the instr, Serial Settings:Number of Bytes at Serial Port, i noticed that the number of bytes currently available at the serial port is always ard 4000. Since for my application, we only need to display 102 of them on waveform graph every time, we set the byte count  in VISA read to 102.
 
BUt by doing that, it seems when everytime the waveform graph refresh itself, it contains previous data. Say after the first 102 bytes have been diplayed on the graph, the second 102 bytes the wavefom displayed is actually 101bytes of original data and plus one more new byte.
 
Just wondering if there is anyway to display totally new 102 byte everytime the waveform graph refreshs itself?
 
I have tried couple of methods but they all didnt seem working.
 
Any help would be highly appreciated.
 
Thanks
 
Kim
0 Kudos
Message 1 of 2
(3,424 Views)
If your device is sending 4000 bytes and you only read 102, then you are leaving a lot of bytes still in the buffer and you've eventually get an error (or warning) when the buffer overflows. You would also be reading old data. If you only want to display a subset of the data, try the attached modification. I also cleaned up the wiring and got rid of all that code related to the quotient/remainder and the for loop. It wasn't doing anything as far as I could tell.
Message 2 of 2
(3,415 Views)