12-05-2013 09:47 AM
No I am not able to open the file in lab view with the same code....
when I run it . in the fraction of second the error comes that your memory is full...
12-05-2013
09:56 AM
- last edited on
12-16-2024
04:12 PM
by
Content Cleaner
-Coming to Labview handling Maximum file size, upto 2gb it can handle.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PADVSA4&l=en-US
-For Handling larger files than 2gb you can try
http://openg.org/tiki/tiki-index.php?page=OpenG+Lib%3A+Large+File+IO
-But in your case, they may not be relevant. can you tell about your system config please?
-What is your RAM and available free size in Task Manager?
12-05-2013 10:00 AM
Now you are saying that your files can be up to 200 MB. That is very different from 160 KB!
Still, with some care it is possible to read 200 MB files. At that size you probably should not use Read from Speadsheet File.vi. It requires at least two complete copies of the data, first as a string and then as the numeric array. If you know the size of the headers (the text portions at the beginning of the file), you can read those lines with Read from Text File. Then in a loop read the remainder of the file in chunks of moderate size (65 KB to a few MB), convert to numeric arrays, and use Replace Array Subset in a pre-initialized array in a shift register. You can get a numeric array of ~200 MB from a text tile with a VI which has a memory "footprint" of about 220-240 MB. Your numeric array may be smaller than the string file, depending on the format used in the file.
Lynn
12-05-2013 10:00 AM
ok
My PC ram is 4 gb and 3,21 I can utilize...
12-05-2013 10:16 AM
Dear Lynn,
Can you send me the VI for that?
I am not able to understand what you are exactly trying to say....
12-05-2013 10:20 AM
I wrote a VI that does that a while back. It may take me some time to locate it. I will post it later today.
Lynn
12-05-2013 10:22 AM
Here is the text file which I have to use...
I cut the some part of my text file... kindly see the attachement....
I know the number of header rows...
But I have to read the fifth row and then as per companys requirement I have to find ,in which column the perticular port is? and then after finding the port column number I have to do the further calculation
12-05-2013 10:22 AM
Your best bet will likely involving streaming the file into a buffer, and reading the buffering. Grabbing the information you need from that, and continuing your processing from there.
This way you don't load 200-300MB+ of RAM full of a file, but instead 1-2Kb at once (same with off loading this file).
Also to 'dance' around you memory cap you can use subVI's with the "Deallocate memory" switched. This will unload them from memory once they complete freeing up more 'usable ram' for you use.
12-05-2013 11:12 AM
Here is my VI. It was written to read and decode text files in the specific format generated by my SPICE program (an electrical circuit simulation program). This is a subVI to a larger program which does a lot of display and data manipulations.
The largest file I had readily available was 191.9 MB on disk. It takes about 15 seconds to read, parse and convert that file to a 2D array of Extended precision floating point numerics. The array size is 126 x 68063 which occupies about 86 MB (depending on platform, as Extended datatype representation varies). The Profile Performance and memory tool shows the VI using 257.48 MB. According to the OS LV occupies about 1.4 GB while running this program. The main program probably makes a couple of extra copies.
The Open state uses a file dialog to select the file to be read and reads the first 7 lines, which contain part of the header. The Get # Variables state parses the header to determine the size of the rest of the header and the size of the data array. Get Variable Names reads the reaminder of the header. Init Data Array initializes one of two data arrays depending on whether the data is real or complex. Read Data Chunk reads the rest of the file 1000 lines at a time, converts the strings to numerics, and places the data in the appropriate array. The Close state closes the file and the Error state handles the EOF error which I used as a normal termination.
This VI will not work directly on your files because the format is different but this should give you an idea of how to approach managing the larger files.
Lynn
12-05-2013 01:34 PM
@mrdesai88 wrote:
Hi Uday,
Sorry for the wrong information regarding the file size... I have to read the file which is ranging from 50 to 200 mb...
Is it possible with labview? First reading and then have to do the large calculation?
I upload the VI for the read from spreadsheet
If the files are that large you will need to read them in chunks and process the individual chunks. You can then aggregate your results as your process the date. Reading a file that large into LabVIEW in a single read is pretty inefficient and slow.