LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write time stamp to a file

Hi,

I'm using LabVIEW 8.2 and for my simulations purpose I've to store my data with time stamp (seconds having 6 digit precision ) in a text file.

I'm using get time vi to get the time of the host computer on a  6 point precision (which I've attached also). My problem is I'm unable to convert this time stamp into string which can be written to text file directly. I would prefer to avoid the "unbundle cluster" which gives me individual elements (like seconds,date,time,year,day of the year, etc) and them convert each of them into a string.

 

Looking to hear from any one of you soon,

Regards

Message 1 of 10
(11,518 Views)

Hi roiht,

how do you need the timestamp? You can use the "Get Date/Time String" function or you convert all your numbers to a string with the "Number to Decimal String" function.

 

Mike

0 Kudos
Message 2 of 10
(11,513 Views)

Hi Roiht

You will never achieve 6 digits precision with the "get date/ time i seconds function" Perhaps 1 if you are lucky. But you can convert the time to string using the "format data/time string" function. You find it in the same palette as the other time functions.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 10
(11,490 Views)

Thanks for the reply,

Perhaps, when after extracting hours, minutes and seconds from this vi and displaying them on a float indicator, I'm able to see the details now. If I change the precision of float indicator for seconds to 6 point precision, I see float values for seconds? Are those values for seconds wrong then ?

 

Looking forward for your reply

0 Kudos
Message 4 of 10
(11,453 Views)
Under Windows you cannot do any reliable timing below 10 ms. In Labview I think I have seen numbers around 20 ms. But I am not 100% sure about the numbers regarding Labview. Try to put the "get time/ date" function in a loop and run 100 times. I am quite sure all timestamps will be equal. But to answer your question. Your value in seconds is correct but limited by the resolution mentioned above


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 10
(11,437 Views)

Your figures for LabVIEW timing resolution using the Get Time/Date in Seconds primitive under Windows are about right.  The actual numbers vary depending on the actual version of Windows and LabVIEW.  Resolution is much better under LabVIEW RT and is superb under LabVIEW FPGA.  You can get much better resolution by querying the Windows performance counter (see attached VIs).  However, due to the multi-tasking nature of Windows XP/Vista, the results can be easily skewed.  For example, if you are timing an operation and an e-mail arrives, you just added half a second or more to your time.  I think the time slice interval on Windows is usually 10ms, and this feeds into timing jitter, as well.

 

One other point.  The LabVIEW timestamp has about 20 digits of fractional seconds resolution (64 bits - it is a 128 bit fixed point number with a 64 bit integer and 64 bit fraction).  Whether you can use this resolution or not is another matter.  If you use hardware timing sources, you can get 10 or more digits of resolution.  If you use a Windows operating system, it is closer to two digits.

 

Let us know if we can be of more help.

0 Kudos
Message 6 of 10
(11,424 Views)

Thanks for the reply,

The files which you've send are in 8.5 version but I'm working on 8.0 versio. Could you please send me the files in 8.0 version.

Thanks

0 Kudos
Message 7 of 10
(11,418 Views)
Here you go.  They cannot be ported farther back than LV 8.0 due to the use of 64-bit integers.
0 Kudos
Message 8 of 10
(11,391 Views)

roiht,

 

Upon rereading your original post, it seems that converting the timestamp to DBL and then converting to string may work.

 

Lynn 

Message 9 of 10
(11,382 Views)

Thanks for the reply,

I actually started doing what is shown in the .png file Smiley Happy . Problem is solved

0 Kudos
Message 10 of 10
(11,369 Views)