08-21-2013 05:03 PM
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
08-21-2013 06:58 PM
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.
08-22-2013 01:14 AM
Show us, what exactly you had tried (your code and sample data)...!!
Can you attach it here??
08-22-2013 03:16 AM
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?
08-22-2013 03:44 AM
--> 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???
08-22-2013 03:50 AM
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)