LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loss of precision in time output

Hi, I am reading photon counts from the SR400 counter in LabView (v7), and require a time stamp so that I can compare them with synchronous GC data. I am able to get accurate double precision time output on my front panel to the fraction of a second, but when the data gets written to file and I open it up in Origin or notepad the data is only displayed to the first six significant figures, ie 3.29297 E9 is readout for the time of say ten values, the 3.29298 E9 for the next ten. I have tried altering everything I can think of to increase the recorded precision, if anyone has any idea on what the problem may be your help will be greatly appreciated!
0 Kudos
Message 1 of 7
(3,696 Views)
I'm not sure why you would get scientific notation since your format specifier is %14.1f.  But try %14.4f.  That will give fractions of seconds to the .0001 (while 14.1 would only give tenths of a second). 
 
By the way, what is "Origin"?
0 Kudos
Message 2 of 7
(3,678 Views)


Ravens Fan wrote:
By the way, what is "Origin"?

http://www.originlab.com/
0 Kudos
Message 3 of 7
(3,675 Views)

Ok thanks I'll give that a go.

Origin it just a spreadsheet package really, but set up for scientific work giving lots of capabilities in terms of analysis etc. and is mush much better than programs such as excel. It is really easy to import ascii into, you don't have to set space delimiters or anything.

0 Kudos
Message 4 of 7
(3,645 Views)
Hi, I tried increasing the %14.1f to %14.4f, and this did increase the precision in my time real-time double precision readout, but still just the same number in scientific format was readout to the file. Can files only save single precision or something? At the moment my file is not even saving to the nearest second, never mind fraction of a second, is there a better way for me to save the data to keep the precision?
0 Kudos
Message 5 of 7
(3,637 Views)
I'm not sure why it still wants to create scientific notation.
 
I just realized you have LV 7.1.  I opened up my version 7.1 and see that the write to spreadsheet file is different than in LV8.5.  It seems that the data type for the array going in is single precision rather than double.  So that may be part of the problem.
 
I would recommend that you open up the write to spreadsheet file VI, look at what it does.  Modify it so that it uses a double array, and save a copy of that under a new name and use that.
0 Kudos
Message 6 of 7
(3,632 Views)

A-ha, sorted it by going in to the "write spreadsheet to file vi" as suggested and increasing the precision to double, and saving it then running that.

Cheers!

0 Kudos
Message 7 of 7
(3,617 Views)