I have a question about serial data.
When I receive the serial data from NI-9870, is it possible to get the time when the data came in?
Can timestamp helpful?
Please let me know.
Solved! Go to Solution.
I just get the time immediately after the message is read. For a RS-232 bus, this is about as accurate as you will really need. If you need more accuracy, then your device that is sending the data should timestamp things and put that information in the message.
Thanks for your reply!!
The code I attached is possible to receive serial data and save as a file that contains time and date?
I'm a beginner so not sure about my code....
Thank you 🙂
1. You should be constantly reading from the serial port to keep the buffer cleared. You can conditionally log the data.
2. No need for the wait since the VISA Read will limit the loop rate.
3. Use the File IO functions to write your file. Open the file before your loop and close the file after the loop.