From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add timestamp into the beginning of DBL array?

Hi..

Does anyone know how to add timestamp into the beginning of DBL array?

I've tried using Get Date/Time in strings and spreadsheet string to array since i know that the elements of the array must be all of the same type..

But lastly, it didn't write the timestamp in full format and only have 1 reading..

I've attached the image of my vi(after i add get date/time) and the result in the excel..

FYI, I am going to save the data in TDMS file and usinf TDMS write..

TQ..

TQ..after add get date time.pngafter add date ex.png

0 Kudos
Message 1 of 8
(3,661 Views)

First of all, don't use Spreadsheet String To Array.  Just use the String To Floating Number function.  Then use Initialize Array with those values.  Set the size to match one of the other arrays.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(3,646 Views)
You could also build an array of waveform data types. A for loop with the build waveform function would work.
Message 3 of 8
(3,639 Views)

Well you can and you cant...

 

Use something like this:

Tsec.PNG

Feed it into your build array and you will have a DBL that is equivelent to the number of seconds elapsed since 12:00 a.m., Friday, January 1, 1904 (LabView  Time Stamp)

 

If you want a DBL that can be directly formatted to an OLE time stamp in Excel or any standard speradsheet program then you need to do some conversions first.

 

LV2OLE.PNG

 

 

 

========================
=== Engineer Ambiguously ===
========================
Message 4 of 8
(3,619 Views)
I also tried connecting 'Get date/time" with "Fract/exp string to number"  then connect the dbl to the initialize array to set the dimension for the array..(pic)
But,the result still show the same as previous..
 
9.9.png
 
0 Kudos
Message 5 of 8
(3,582 Views)
What you are doing does not make much sense. You won't get a proper timestamp for tdms that way.
Message 6 of 8
(3,572 Views)

@Dennis_Knutson wrote:
What you are doing does not make much sense. You won't get a proper timestamp for tdms that way.

 

What should I do then?could you please show me how to build an array of waveform data types as per you told early?I have no idea at all...Smiley SadSmiley Embarassed

0 Kudos
Message 7 of 8
(3,564 Views)
Use the build waveform function on each of the 1D arrays.
Message 8 of 8
(3,553 Views)