LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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
0 Kudos
Message 1 of 8
(4,216 Views)

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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,213 Views)

@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
0 Kudos
Message 3 of 8
(4,203 Views)

@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
0 Kudos
Message 4 of 8
(4,200 Views)

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.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 8
(4,196 Views)

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
0 Kudos
Message 6 of 8
(4,186 Views)
Solution
Accepted by topic author newbieeng

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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(4,183 Views)

@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
0 Kudos
Message 8 of 8
(4,176 Views)