LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to append Get Date/Time vi into a the start of a 2D array

Does anyone know a way of appending a date and time string into a numeric double. I have attached my code. Perhaps i should append after the numeric/string conversion?
0 Kudos
Message 1 of 7
(3,105 Views)
Hello,

The elements of an array must be all of the same type, so you can't do that.
To have different types in a structure you can use clusters instead.

Paulo
0 Kudos
Message 2 of 7
(3,097 Views)
You can actually do this without clusters in one of two ways:
1) LV stores time as the number of seconds that have passed since 1/1/1904 00:00:00, so you can store this number. To do this, use the Get Date\Time VI from the Time&Dialog palette, and convert the timestamp to a DBL (using To DBL from the Numeric>>Conversion palette). This isn't readable because the number is currently 3.something * 10e9 but LV can turn it back into time. I suggest using this method because you can easily manipulate this time format in LabVIEW (compare, add, subtract and so on).
2) The other way would be to create a number to represent your data (like 10022004). This has several problems and I think using clusters is preferable.

___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(3,088 Views)
Also, If you use the Date\Time to seconds VI you get a cluster of all the values. Use unbundle on that cluster to get Month, Year, Day and so on.

___________________
Try to take over the world!
0 Kudos
Message 4 of 7
(3,077 Views)
"Perhaps i should append after the numeric/string conversion"

Since it looks like you're going with a table and need a 2D array of strings anyway: Yes.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 5 of 7
(3,073 Views)
Hi Donald.
I quite simply didn't notice that part of the code (and the question).
This seems to be a real issue,

___________________
Try to take over the world!
0 Kudos
Message 6 of 7
(3,060 Views)
Spot on Donald. Many thanks.
0 Kudos
Message 7 of 7
(3,054 Views)