LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error:End of file encountered.

Hi;
I have a VI that uses Read from  binary file  LabVIEW Measurement File VIs multiple times. The first time I read   the  file it works fine but each call to the Read  File VI after the first results in Error 4 occurred at Read LabVIEW Measurement File -> Express_vs_Easy_File_IO.vi. The possible reason is that the end of file was encountered. How can I fix it?

Thanks

0 Kudos
Message 1 of 6
(10,709 Views)

It is hard to say for sure without some code to look at.  But here is what it sounds like to me.  You are reading the entire file on the first read, which is fine.  But you didn't close you file.  So if you just read the file again, the file pointer is already at the end of the file.  So of course you are going to get an end of file error.

 

So my first question is why are you rereading the file?  Just save the results somewhere in memory, like a shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(10,691 Views)

Show us, what exactly you had tried (your code and sample data)...!!

Can you attach it here??


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 3 of 6
(10,671 Views)

My program is a data acquisition  model, it's a bit complicated , look at Daq, the false case and then the true case.

I fixed the reading ,now I have another problem  ,every time it opens the  file it  switches between  the arrays, I read data and arrange it as 2D array, and display them in waveform chart in 2 channels.  the second time   it  opens the file and read, it switches between the 2 arrays, and so on(as seen in the attached fig) .  what could be the problem?

Download All
0 Kudos
Message 4 of 6
(10,660 Views)

--> Why are you reading twice the Number of Samples but while reshaping using Number of Samples as one input (and 2 as other).

--> Why exactly are you using Reshape array function in your program (specifically in TRUE case)??

--> Where are you reading and updating the chart???


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 5 of 6
(10,650 Views)

In  my file there are ECG and respiratory data, so after reading i'm reshaping to  get 2D array which  it's 1st column is ECG  and the 2nd is respiratory.

I have another  VI   that uses FGV to read  the data  from   the queue and display it in the chart (which is located in my Main VI)

0 Kudos
Message 6 of 6
(10,648 Views)