LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read fast 50 MB Excel file in LabVIEW

Hi,
I have created a datalog file containing string i/p and having extension ".exl". File size is around 50 MB. When I read this file using LabVIEW, it takes 1/2 hour to display data in Array. How can I minimize this read time in LabVIEW. Or is there any options available to create large datalog files with string i/p and read it fast?

Examples are well appriciated.

Thanks.
0 Kudos
Message 1 of 8
(4,046 Views)
Hello,

Do you need to display all of the array (50MB worth of data) in the front panel? You can monitor your VI's performance by going to Tools -> Advanced -> Profile VIs and see where it is spending the most time. It would be helpful if you could post your VI that reads your datalog file.

Thanks and have a great day!
Shakhina Pulatova
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(4,016 Views)
Hello Shakhina,

Ok. I am posting my code.
If you know any alternate for reading big file is well appreciated.

Thanks
0 Kudos
Message 3 of 8
(3,994 Views)
To read large files, use File Open, File Read, File Close vi. Open file for read (the vi should return the file size), next, inside either a while loop or for loop, read the file continuously, every time read a certain number of bytes, last, when finish reading all the data, close the file.

-Joe
0 Kudos
Message 4 of 8
(3,972 Views)
Yes, the lower level VIs are faster (Read From Spreadsheet VI eventually calls Read File anyways). You can get an idea from the shipping examples Write to Text File.vi and Read from Text File.vi (just ignore the graph and timestamp parts).

Good luck!
Shakhina P.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 8
(3,952 Views)
What kind of file is it? If you are writing datalog files, there is no reason for giving them excel (.xls) extensions. Excel cannot read datalog files. The other way around, native excel files cannot directly be read by Labview.
In general terms this is what you may look into:
-use a compact file format like (real)datalog, fully binary or at worst plain ascii text file.
-you do not have to read the whole file into memory at once, depending on your application.
-look at your (RAM) memory space: it sounds like you are running very low on memory and the OS needs to pagefile most of it. Try closing all unnecesary programs and/or buy more memory. Also look for memory hogging inside your code: releasing data that is no longer needed will free memory used by labview. "Uninitialized" arrays for example may seriously slow down a computer.

my two cents,

aartjan
0 Kudos
Message 6 of 8
(3,943 Views)
Correct me if I'm wrong, but I think you are misusing the term "datalog file".
A datalog file is a LabVIEW file type, with binary contents. It is NOT an Excel file, regardless of what extension you give it.
I can open a 20 Meg Datalog file and display a 13000-sample graph from it in about 3 seconds.
You need to clarify what you want to do.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 8
(3,942 Views)
If you are reading in a 50MB text file, you need to seriously rethink how you are storing and displaying your data. I would recommend the tutorial found here (search for "large data labview" in the main ni.com search bar if the link doesn't work). I would also strongly urge you to use a binary solution.
0 Kudos
Message 8 of 8
(3,913 Views)