LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time stamp help

Solved!
Go to solution
Hello, I have made this VI to collect measurements and I would like to record Date and time of the measurement in the same file but in different column than the measurements. Since I can't send data directly into an Excel file, I am collecting it in .txt file and then import it to Excel. Any suggestions will be greatly appreciated. Thanks.
0 Kudos
Message 1 of 6
(3,355 Views)
Solution
Accepted by JayP
You can put your data into an array of strings and then send it to either the "write spreadsheet file" funciton, or pass the array through the "array to spreadsheet " function then write it to a text file. This puts delimiters, like tabs or commas, that make it easy to write excel readable files. If you do the later technique you can either have a time entry appended to the beginning of each data entry, or if it is just for header info showing when the tests took place you can write it to the text file, then append the spreadsheet formated test data to the file so that it will show up in you text file as lines of delimited data.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 6
(3,341 Views)

Hi Putnam,

I have made changes to the VI following your suggestions and it works to my purpose. I have attached the updated VI for you to see. I was making changes to my need but did not end up using "array to spreadsheet". Please advise me if you think there is any better way or improvements I can make to this VI. Thanks for your help.  

0 Kudos
Message 3 of 6
(3,324 Views)

 here's a "better" method Smiley Wink  Time is stored in Excel as a number but displayed as a date-time.  If you ever want to graph vs time you can't use the time text since Excel doesn't really understand that the string "1/1/1900 12:00:00.0" = 1.

 

Oh- Now that I moved my reuse library to 2009f3- I took the time to add a work-around for the infamous Excel 1900 leap-year bug

 

EnjoySmiley Wink


"Should be" isn't "Is" -Jay
Download All
Message 4 of 6
(3,312 Views)
Thanks for the "better" method Jeff but I will not be using time data for graphing purposes. I will be using pulse-count data vs measurements for graphing. I am working on the final VI and having difficulties incrementing total pulse count so that it will add measurements to total pulse count. I will post the final VI soon to see if you can give any suggestions. Thanks.
0 Kudos
Message 5 of 6
(3,290 Views)

Hi Jeff,

 

just found your Time-to-Excel VI and have to report some minor problem:

When using your VI on a German WinXP your "Zone" output is misformed due to German umlauts in the timezone string.

"%Z%z" results in "Westeuropäische Normalzeit01:00:00" which is converted to "WäN01:00:00" by your filtering loop. But who needs this string anyway?

 

The remaining VI looks quite nice!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,874 Views)