LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timestamp to double

Hello,
I finally got my report generator to work, but there is still one problem. To create a graph, an array of doubles is needed. I have an array of strings, containing two columns, one with a value logged with the DAQ, and one with timestamps. Does anyone knows a way to convert this to an array of doubles?
An other thing is an excel thing: when I load the timestamp in excel, the cell is formatted in MM:SS, and it should be HH:MM:SS.uuu.

Does anyone has a solution? Thank you.
0 Kudos
Message 1 of 5
(3,551 Views)
Regarding your first problem
- you can use Frac/Exp String To Number for column 1
- you can code a subVI to convert the timestamp in a double (it depends on how do you want it - my idea would be [nr. of seconds].[uuu])
Let us know if you need help
Message 2 of 5
(3,551 Views)
Thank you for answering my question. For column one there is no problem, but column two was different. I do not realy understand what you mean by [nr. of seconds].[uuu] format, but here is what I did:
I inserted a formula node and with a series of 'match case' structures, I had H M S and uuu seperately. In the formula node I calculated everything to [uuu] which gives a big number. When I divide that number by the [uuu] number for 24:00:00.000, I get the number that excel generates for my time, so I figured that I could use that number too. In excel it works just fine, now I'm searching to get it in word.
Don't know if this is what you meant, but it seems to work for the moment,

thanks.
0 Kudos
Message 3 of 5
(3,551 Views)
Okee, shouted too soon. My solution works well for tables, but when I make a graph of it, it is not the time which is displayed, but the value I have calculated. Could you explain your solution to me please?
thank you...
0 Kudos
Message 4 of 5
(3,551 Views)
My idea was to have a floating-point value for your time representing your time in seconds. For example, 00:02:15.001 will be 135.001 ... so, in this case you have second as unit for time (instead of ms).
Regarding your graph problem, it looks like it's more esthetic then functional as long as you have the right timestamp value in ms.
Anyway, two ideas:
- leaving the initial time format (HH:MM:SS.u), try to format those cells after PASTE (in excel, as you said, the standard format including [uuu] is MM:SS.u) - choose CUSTOM format and type "hh:mm:ss.0"
- in word it seems to be more difficult ... even though, a VBA Macro could be the solution to change the labels as you want
Hope this helps somehow...
0 Kudos
Message 5 of 5
(3,551 Views)