06-25-2009 02:47 PM
I need to write a date time stamp in format of day:hour:min:second (25:13:23:56) to a spreadsheet file. Ideally using the output from "Format Date/Time String" and going into a "Build Array" from there it goes into write to spreadsheet. The only reason this is the format necessary is because I have a program data logging 10 scientific meters already up and running. It uses the date stamp from a Datetime.vi that is in integer form 132356.
Thanks in advance for your help
Solved! Go to Solution.
06-25-2009 02:56 PM
It seemed as though you were very close to the solution.
Review the attached modified VI and see what you think.
Take notice of some of the changes I made.
06-25-2009 03:01 PM
I should have told everyone I'm still stuck in Labview 7.1 Unfortunatley that means I get an error when trying to open your solution. Any thoughts?
06-25-2009 03:44 PM - edited 06-25-2009 03:46 PM
Hi nas1,
CCornish' solution will not work for you as WriteToSpreadsheet is limited to SGL data in LV7.1. (Sidenote: put you LV version info in your signature, so you can't forget to mention it...)
You don't say how to format that timestring exactly. Should it be put in a "cell" togetherwith more data in the same row or should it be just one line?
In the latter case you could use "WriteCharactersToTextfile" instead in appending mode... Otherwise there's the "array to spreadsheet string" function to make your own conversion routine. Look into theWriteToSpreadsheat as an example!
06-25-2009 03:55 PM
nas1,
This is a shot of the code I use to convert to spreadsheet time format. Excel can display this number by formatting the cell as time in any format. It gives you the added benefit that calculations can be done in Excel (such as, get elapsed time, or ,create a graph vs. time,) You can't do that from text. Lotus uses the same epoch (start date) and scale as Excel but, I haven't used it so I don't know if the calculations work there. They should.
06-25-2009 03:57 PM
06-25-2009 04:03 PM
Jeff, we are not using either excell or Lotus because our data sets are too large. They exceed the max number of lines, so we are using Kaliedagraph. But anyway, they the data processors, want the time stamp to have the day of the month before the time. ie day:hour:min:sec this usually precludes you from using built in time functions of many softwares.
N
06-25-2009 04:14 PM
06-25-2009 04:17 PM
06-30-2009 03:03 PM
Alright folks, Thanks for your help so far, I've decided to include the larger vi so you can better understand what I'm trying to do. At the top of the array, I have two blue (numeric) leads carrying date and time information. I need the date to be left alone and the time to be in the form of Day:Hour:Minute:Second, the only way that I have been able to get the time into this form leaves me with a pink (string) lead. The array won't allow this as an input. Below is my current data string output (3 lines) and below that is what I want (3 lines although with out the linewrap issues thats a forum thing) the red is all I've changed.
712008 115047 8.47 24.1 6.92 24.1 6.76 74.8 6.74 74.9 -0.003 24.48 0 -0.045 24.467 0 0.201 0.201 27.2 0.005 0.005 27.8 1.652 1.785 0.855
712008 115051 8.47 24.1 6.93 24.1 6.76 74.8 6.74 74.9 -0.003 24.479 0 -0.045 24.467 0 0.199 0.199 27.2 0.003 0.003 27.8 1.647 1.786 0.851
712008 115055 8.47 24.1 6.93 24.1 6.76 74.8 6.74 74.9 -0.003 24.479 0 -0.045 24.467 0 0.197 0.197 27.2 0.005 0.005 27.8 1.578 1.693 0.812
712008 12:11:50:47 8.47 24.1 6.92 24.1 6.76 74.8 6.74 74.9 -0.003 24.48 0 - 0.045 24.467 0 0.201 0.201 27.2 0.005 0.005 27.8 1.652 1.785 0.855
712008 12:11:50:51 8.47 24.1 6.93 24.1 6.76 74.8 6.74 74.9 -0.003 24.479 0 - 0.045 24.467 0 0.199 0.199 27.2 0.003 0.003 27.8 1.647 1.786 0.851
712008 12:11:50:55 8.47 24.1 6.93 24.1 6.76 74.8 6.74 74.9 -0.003 24.479 0 - 0.045 24.467 0 0.197 0.197 27.2 0.005 0.005 27.8 1.578 1.693 0.812
Thanks in advance
Nathan Smiley
Labview 7.1 and 8.5