LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read File

Hi,

I included a VI that uses the 'Read File' VI. When I try to read the included text-file I get the following error:'Not enough memory to complete this operation'.
Why this error? How can I catch this error when the user selects a file like this?

Greetings

Davy
Download All
0 Kudos
Message 1 of 4
(2,987 Views)
There are a couple things to comment:

1) your file format appears to be an INI file. You should maybe use the Config File VIs to read keys from the file instead of reading the entire file as text.

2) Your Example VI is using low-level File IO functions, and improperly. If you are trying to read the entire file, then you need to find the EOF to know the file size and then read that many bytes.

I have attached an example with a few options for you to look at.
0 Kudos
Message 2 of 4
(2,987 Views)
Thanks Jim, I understand. But do you maybe know what is the cause of the error I mentioned.

Greetings

Davy
0 Kudos
Message 3 of 4
(2,987 Views)
I believe that the error might be caused because you wired a string to the "bytes stream type" input. LabVIEW then read the file and assumed that it contains the *flattened* data of a string (this is different from a text file). The flattened data of a string is precedded by its length, which was some insane number or it attempted to read past the file's end, or something similar. Basically the attempt to read the file in the mannor chosen was not appropriate and LabVIEW choked while attempting to perform the requested operation.
0 Kudos
Message 4 of 4
(2,987 Views)