LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timestamp doesn't match data

Solved!
Go to solution

Hi, I am reading in 3 pieces of data every 10 seconds, and saving it using the Write to file function, along with a timestamp wired to the comments pin of the function. However, it looks to be that the first timestamp value is incorrect, and each piece of data thereafter is incorrectly labeled.  If you look at my attachment, the first 3 time points in seconds (x_value) are 0, .007 and .113007, and the associated timestamp is 1:44:24, 1:44:33 and 1:44:33. Now, the next 3 time points in seconds are10.00057, 10.00257, and 10.07058 and the timestamps are 1:44:33, 1:44:43 and 1:44:43.  The first timestamp of the second 3 points (1:44:33) should have been with the first 3. The time in seconds appears to be correct, but how can I make sure the timestamp is stamped to the correct data point?

Download All
0 Kudos
Message 1 of 4
(2,246 Views)
Solution
Accepted by topic author baseball07

I think you may be getting burned by waiting on the bluetooth connection.  Since the read date time is independent of the bluetooth read, it executes as soon as the loop starts.  If the bluetooth read takes ten seconds to execute (for example it has to wait on data), then the data time block executed long before the bluetooth read finishes.

 

Try placing a flat sequence structure around the Get Date/Time and Write Measurement File portion of your code so that the only wire coming into that structure the Voltage.  See if that fixes your timing issue.

 

You can always create your own Get Date/Time vi with error terminals in order to use the error wire to enforce dataflow.  That'd be a cleaner long-term solution than using the flat sequence structure.

Message 2 of 4
(2,239 Views)

You get the time in  two different places, so of course they won't match.  Try eliminating one and use the data from the remaining one for both.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 4
(2,225 Views)

Thanks, the flat sequence structure worked great.

0 Kudos
Message 4 of 4
(2,177 Views)