LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem when exporting to excel (comma/dot?)

I am building a LV app to log and present temperature data. I have also added the possibility to export all values into exceel for further analysis. Only problem is that when I do this, e.g. a temp of 23.540 is read into excel as 23540. I've tried changing local setting, excel settings and so on, but since this app will be used by several people, all with different settings, I need the export process to work no matter what their individual settings are. (If this is not possible at all, a dot as separator is prefered). I'm thinking either to let excel know bu some API call, or I'm all open for suggestions.
 
I'm using LV 8.5 Full dev. system
 
Tried screenshotting only the relevant part, but it did not fit, so I'm attaching the main VI, the subVI's are not needed for that part of the problem.
 
Attaching output textfile, partial screenshot, excel screenshot and main VI
 
/Anders



Message Edited by Tohatsu on 01-09-2008 03:43 AM



Message Edited by Tohatsu on 01-09-2008 03:44 AM
Download All
0 Kudos
Message 1 of 5
(10,755 Views)
a) There is a switch in the float to string function called "use system decimal point". Set that to
true and all data should match on the local computer.


b) The format into string function can format floats using either decimal separator.

"%.;%f" will format using the decimal separator.
"%,;%f" will format using the comma separator.

These format commands are described in the LabVIEW help file.

Before you write the spreadsheet, your program can perform an experiment
with a string constant. Convert the string "8.2" to a float and convert the string
"8,2" to a float. Whichever is correct determines the format string to use.

Sharing the excel files between two computers with different decimal separator
is a different matter. This is where data stored in binary format, like a cluster datalog,
is an advantage.
Message 2 of 5
(10,739 Views)
a) - tried, did not make any difference
 
b) apparently "format into string" was what I wanted, as even if I selected point as system wide setting, is still refused to export the decimal separator when using "Number to fractional string" and "%.;%.3f" was just what I wanted, thanx! And for some reason, now it works whatever the system is set to use...Exellent reply!
 
/Anders
0 Kudos
Message 3 of 5
(10,729 Views)
Go into Tools:Options and "Front panel" and uncheck the "use system decimal point" or whatever it is called. Then restart Labview
Message 4 of 5
(9,991 Views)

Hey laserboy, your tip was very useful for me, thank you very much. I think your answer must be the solution. You have to uncheck the USE LOCALIZED DECIMAL POINT at Tools, Options, Front Panel. I'll see if I can give you a kudos.

Impossible is nothing
0 Kudos
Message 5 of 5
(8,920 Views)