LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read spreadsheat file

I want to read Data form a txt-file into LabVIEW. The data looks like 1.23456E-7. LabVIEW only takes three digits at the right side from the ".". How can I handle this?

Arno Smeets

PS: You can answer in english, german or dutch.
0 Kudos
Message 1 of 7
(3,282 Views)
Hi Arno,

Since I'm French I'm gonna try to answer in English.

I've attached a little image of what is possible to do in order to read characters from file. the file tested is only made of "1.23456�-7"

Hope this helps !
Julien
0 Kudos
Message 2 of 7
(3,282 Views)
OOOps ! I meant "1.23456E-7"

Julien
0 Kudos
Message 3 of 7
(3,282 Views)
Change the format to %.6f instead of the default %.3f and this should take care of you.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 7
(3,282 Views)
Hi,

your answer helps but LabVIEW only reads 6 digits at the right of the ".", I need more, f.e. 1.234567890123e-10. Some other questions:

1) How do I read every number in the file? Probably a while-loop, but I have no expoeriences with them yet.

2) How did you make the jpg-file?

Thanks a lot, Arno Smeets

PS: If I get "source-code" again, please write the (english) function-name to the icon. Thank you
0 Kudos
Message 5 of 7
(3,282 Views)
Hi Joe, I tried that, but it didn't change anything. Even "%.2f" did not work, it still were three digits right to the ".". Julien's suggestion works better, but is more complicated.

Arno
0 Kudos
Message 6 of 7
(3,282 Views)
The problem you've got here is just a question of display. It seems obvious that the indicator you've used to display the result has its property -> Format and precision -> significant (or precise) numbers set to 6.

If you change this property : right click on the indicator -> Properties -> Format and precision -> and change significant numbers to something else you'll see the difference.

I've attached a VI (L70 and LV61) that shows you how to read all the numbers in the file if the file is made like the one I'e had to this reply.

Screen shot and use MS Paint to make a jpg file. This is what I often do when the questionner doesn't say which version of LabVIEW he or she uses...

Hope this helps !
Julien
0 Kudos
Message 7 of 7
(3,282 Views)