Hello,
I assume that you are using LabVIEW, please let me know if you're using another development environment.
The serial interface does not support direct time stamping, but you can timestamp data as soon as you receive it into the LabVIEW software buffer by using the "Get Date/Time in Seconds" and "Format Date/Time String" VI's. Of course, this won't be as accurate as
hardware timestamping.
Regarding your problem receiving the same data in separate iterations of the loop, this is probably because your device is actually sending the data more than once. Once you read data from the software buffer, it is gone. The only way that it will come back is if it is again received on the serial port.
Try using the LabVIEW <-> Serial example under the Exampl
e Finder to eliminate possible programming errors. Also, using Hyperterminal will show you for sure whether or not your device is sending out the data multiple times.
If you do need to clear a software buffer attached to a serial port, simply perform a read with the number of bytes you would like to clear.
Hopefully this has helped your understanding of the problem and possible solutions; if not, please let me know by posting here.
Scott