LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp to milliseconds

Solved!
Go to solution

I am trying to compute elapsed time from Timestamps datatypes  with millisecond (or better) resolution.

 

If I use a feedback node in a loop and subtract the previous iteration Timestamp value from the current iteration Timestamp value, I get a deltaT, but only to 1 second resolution.

 

I think that timestamps are a composite of a I64 (for seconds) and U64 (for subseconds), but cannot figure out a way of breaking the timestamp up into those two components.

 

 

Rick

 

PS: I need to do this with Timestamp data types as the data is coming via a datasocket from another system downstream that is actually doing the timestamping and I can't change that.

Rick Foster
MIT Kavli Institute for Astrophysics and Space Research
0 Kudos
Message 1 of 4
(5,463 Views)

Rick,

 

Please show what you are doing. I get resolution to much smaller than millisecond resolution (although the accuracy is probably not that good).

 

Lynn

0 Kudos
Message 2 of 4
(5,455 Views)
Solution
Accepted by topic author Rick_F_Foster

seconds is an I32 and fractional seconds is a DBL..Example_VI.png

Message 3 of 4
(5,442 Views)

Try to capture the timestamp values from the remote system into an array and see if the individual values contain fractional seconds.

 

My guess is that the remote system is reducing the precision to seconds before publishing via DataSocket.


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 4 of 4
(5,409 Views)