NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Active Participant
newbieeng
Posts: 255
0 Kudos
Accepted Solution

Read from spreadsheet file vi rounds the number and does not show precision digits

hi guys,

I am using a "read fom spreadsheet file vi" in a program to read a table but it turns all numbers in the table just with their significant digits. I need at least 6 precision digits, but I really was not able to find the solution to do that. how could I adjust it? By the way, I could not see any adjusting function by right-clicking both "read from spreadsheet.vi" and array indicators, even in their "properties". I attached the vi.

Egemen
Proven Zealot
GerdW
Posts: 7,156
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits

Hi newbie,

 

- did you set all indicators to show more digits?

- what decimal separator does your system use? Did you check the format string input of ReadSpreadsheetFile? Did you read the context help to know what "%.;" means?

Best regards,
GerdW


CLAD, using 2009SP1 + LV2011SP1 on WinXP+Win7+cRIO
Kudos are welcome :smileywink:
Active Participant
newbieeng
Posts: 255
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits

[ Edited ]

GerdW wrote:

Hi newbie,

 

- did you set all indicators to show more digits?

- what decimal separator does your system use? Did you check the format string input of ReadSpreadsheetFile? Did you read the context help to know what "%.;" means?



- As I said before, I could not see any function to set indicaters to show more digits even I enter to their properties. I attached a print screen of properties of an indicator array.

-the system use "." dat as a decimal indicator. How can I check format string of ReadSpreadsheetFile?

Egemen
Active Participant
newbieeng
Posts: 255
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits


GerdW wrote:

Hi newbie,

 

- did you set all indicators to show more digits?

- what decimal separator does your system use? Did you check the format string input of ReadSpreadsheetFile? Did you read the context help to know what "%.;" means?


I changed the all "," in the txt file with ".". After this change, labview program read all values in the txt correctly. Thanks.

 

Egemen
Active Participant
stevem181
Posts: 231
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits

From the Help on Read From Spreadsheet File:

 

rfs.png

 

Try setting the "format" to "%.6f".

 

If you are still having problems, attach your data file so we can try it out.

 

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Active Participant
newbieeng
Posts: 255
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits

[ Edited ]

hi stevem181,

 

I thought the problem was not relevant the format of the "read from spreadsheet.vi". I have never changed the format of this vi. Once I changed all "," in the txt file with ".", the vi starts to read digits of precision correctly. Thanks.


stevem181 wrote:

From the Help on Read From Spreadsheet File:

 

rfs.png

 

Try setting the "format" to "%.6f".

 

If you are still having problems, attach your data file so we can try it out.

 

steve




Egemen
Proven Zealot
GerdW
Posts: 7,156
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits

[ Edited ]

Hi Newbie,

 

in your picture you only looked at the array properties. You have to look at the porperties of the numeric indicators instead... Doh.

 

The format string has been explained by now.

I would recommend to use "%,;%f" to read your original files (with comma as decimal separator). Read the help for those format codes!

 

Edit: I wouldn't call it "solution" when I had to edit all my textfiles before loading them in LabVIEW...

Best regards,
GerdW


CLAD, using 2009SP1 + LV2011SP1 on WinXP+Win7+cRIO
Kudos are welcome :smileywink:
Active Participant
newbieeng
Posts: 255
0 Kudos

Re: Read from spreadsheet file vi rounds the number and does not show precision digits


GerdW wrote:

Hi Newbie,

 

in your picture you only looked at the array properties. You have to look at the porperties of the numeric indicators instead... Doh.

 

The format string has been explained by now.

I would recommend to use "%,;%f" to read your original files (with comma as decimal separator). Read the help for those format codes!

 

Edit: I wouldn't call it "solution" when I had to edit all my textfiles before loading them in LabVIEW...


Thank you. I thought it was relevant to operation system decimal seperator choice, but it is clear now. thank you again.

Egemen
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page