Showing results for 
Search instead for 
Did you mean: 

Insert time stamp

I am writing continuously a 1D array of waveform (DBL) to a file using the write to spreadsheet file VI, and I would like to write a time stamp in the excel file for every acquisition.
I tried using the Get data/Time in seconds function but failed.
How would I be able to do that?
Thanks. (LV 8.2)

Message Edited by RJP on 02-29-2008 08:41 AM
0 Kudos
Message 1 of 11
Well, you use the Get Date/Time in Seconds function. If you want this as a separate line in the file, just convert it to a string and use the Write File before using the Write to Spreadsheet. If you want to append a timestamp to each element in the data array, convert the timestamp and data to strings and use  Write to Spreadsheet in String mode.
If you are acquiring data from an NI DAQ board, you can also get a timestamp if you request waveform data type. You can then use either Export Waveforms to Spreadsheet File or Write to Measurement File.
0 Kudos
Message 2 of 11
How can I convert my data ( 1D array waveform(DBL) to a string) ?

0 Kudos
Message 3 of 11
Number to Fractional String. The functions on this palette (String>String/Number Conversion) are polymorphic and accept scalars or arrays.
0 Kudos
Message 4 of 11
I had already tried that and got the following error:

"Generally, polymorphic terminals accept any wire type connected to them. But sometimes these terminals only accept a limited subset based on other wire types connected to other terminals. The most common cause of this conflict is using the type cast node to cast between incompatible types, such as a 2D array and a string. Check the terminals connected by this wire and change that node to make this wire type acceptable."

Even though I am connecing a 1D array of Waveform (DBL) to the function.
Thanks Dennis for all your help.


0 Kudos
Message 5 of 11
Now I'm confused at what you are doing. There is a waveform data type and a DBL data type. A waveform data type cannot be wired to it but a DBL datatype can. If you have a waveform datatype, this has timestamp information and you don't need the Get Date/Time function. If you are trying to save waveform datatypes, use Export Waveforms to Spreadsheet File or the Write to Measurement File. If you posted the code you've written, it would be much simpler to see what you've done and what you are trying to do.
0 Kudos
Message 6 of 11
Thanks Dennis it worked.

0 Kudos
Message 7 of 11

Smiley Happy


Hello guys


Could you check my code and tell me why my waveform chart doesnt show the Y value paired with the Date and time. Altough it sohws it correct with the cursor.... funny thing.

Just coment please any suggestions or upgrades that i could make to it so it work better.

0 Kudos
Message 8 of 11
Hi isaac,

that's easy:
Your timestamp aren't shown correctly, the millisecond part is hidden! When you change the formatting you will see the difference! Your current vi shows only rounded values, that's why you say "Y value paired with time"... See attachment, x-scale has different formatting now and formatting of timestamp for table has been changed...

It's not nice to attach "run when opened" vis here - it's like spreading a virusSmiley Wink
Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11

Thank you Gerd,


Sorry about the "run when opened" i let it cheked not intentionaly  because i was trying to make my VI visible when called from main VI. I discovered that only when selecting in Windows apperance option "Dialog" it shows the VI.

Back to it then, i was wondering, i only need to show seconds in my graph and table, it is just posible to cut the milliseconds off?



0 Kudos
Message 10 of 11