LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writting to excell

Hello,

I am trying to write values into a file (.xls). everything works fine except for numeric values over 1. If I set 0.2f to write "2.056" it'll write "2.06" and that's ok. However if I want 3 numbers after the comma : 0.3f , It will replace the comma in " 2,056" by a space.


Could anyone help me?

Thanks a lot,


Marc
0 Kudos
Message 1 of 11
(3,952 Views)
Funny that !
Does not happen on my machine. (LV 7.1).
Could you post an exemple ?
CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 11
(3,938 Views)
What language is your Windows OS and Office software?
How exactly do you write to excel in LabVIEW? Do you use the Report generation toolkit for MS office, use OLE automation, etc., or are you simply writing e.g. a plain text table to a file with extension .xls?
What is your setting in "Tools..options..Front panel: Use localized decimal point"?
0 Kudos
Message 3 of 11
(3,934 Views)
Hi Marc,

That is true. Besacuse of ","(comma). If you can avoid to use of ","(comma) seperator, everything will fine.

Thanks.
0 Kudos
Message 4 of 11
(3,914 Views)
Hi ii,

I have made a very simple VI to explain my problem that I have still not solved. ( I have also put what it writes in my excell file). I f you compare the colums in the excell file you will see that the one on the right is ok but not the middle one.

Thanks for your help ,

Marc
0 Kudos
Message 5 of 11
(3,901 Views)
Hi altenbach,

I have made a very simple VI to explain my problem that I have still not solved. ( I have also put what it writes in my excell file). I f you compare the colums in the excell file you will see that the one on the right is ok but not the middle one.

Thanks for your help ,

Marc
0 Kudos
Message 6 of 11
(3,899 Views)
Hi Charly,

I have made a very simple VI to explain my problem that I have still not solved. ( I have also put what it writes in my excell file). I f you compare the colums in the excell file you will see that the one on the right is ok but not the middle one.

Thanks for your help ,

Marc
0 Kudos
Message 7 of 11
(3,896 Views)
Marc,

Whatever you are writing has nothing to do with excel, so you should not call the file *.xls, which is a proprietary microsoft file format. Write your file e.g. as *.txt and look at it in notepad. It will look fine.

By naming your file *.xls, you artificially force it to be opened with excel and excel must try to guess how to read and convert it. It will make mistakes.

As far as I can tell, (at least on a US computer), the comma is treated as "1000" separator. In the US, your LabVIEW program will uses a "." instead of a "," as decimal separator and everything works correctly.

I would recommend to disable the localized decimal point in LabVIEW. (uncheck: "Tools..options..Front panel: Use localized decimal point"). In addition, you should also structure the output a bit better. Get rid of the spaces in the format string so the numbers are cleanly separated only by tabs.

(Sorry, I cannot test in more details because I only have a US computer).
0 Kudos
Message 8 of 11
(3,893 Views)
Hi Marc,
Your VI is working fine as per requirement on Windows XP,MS-OFFICE-2000, LabVIEW 7.1.

Please check your system configuration, it should work.

All the best.
0 Kudos
Message 9 of 11
(3,684 Views)
Hi Altenbach,

Thanks for answering. I have unticked the option and for works fine now !

I have another little question to ask you. I am acquiring voltage with dag assistant in my main program. I have put it in a while loop without any temporisation to get the data as fast as possible ( because I am making an average of the last three values). I have used local values to access the voltage values outside that loop. However When I want to access the value in two other loops ( both in parallele with this one) I get different time refreshing :

Loop 1 in parallele ( tempo 500 ms) : local value is refreshed fine every 500 mS

Loop 2 in parallele ( tempo 500 ms too): local value is refreshed as fast as in the loop where the daq inters the values into the local variable. The only differece between loop1 and 2 is that loop 2 writes the data into file and reads other sensors ( that are refreshed ok at 500mS ). ( However it also writes fine the value of variable every 500 ms in the file....).

Do you have an idea of the problem?


Thanks a lot,

Regards, marc
0 Kudos
Message 10 of 11
(3,880 Views)