From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read waveform from file error: end of file

Hi,

I want to to save waveforms from DAQ and then, after the acquisition is stopped, I want to see again that waveforms to analyse my data.

I tried to do a simple VI in which simulated signals can be saved to a file and can be read drom that file too. This is possible by using a Save Button and a Read Button. The problem is that when the Save Button is OFF and the Read Button is ON the error "End of file" occours, even if I know that there are more data that can be read from the file.

I read from

http://forums.ni.com/t5/LabVIEW/End-Of-File-Error/m-p/387817#M193812

that this could be solved by choosing the option "Reload for each call" for the Read block, but it doesn't seem to work.

 

Does anyone have an idea to solve that?

 

Thanks

0 Kudos
Message 1 of 2
(2,527 Views)

First, a suggestion -- since your file name is the same every time, put a single instance of it outside your While loop and bring it into the loop as a "tunnel", using the same wire for all your Case statements.

 

I don't understand the logic of your construction.  You have a While loop that never stops.  As long as "Write" is true, it writes to a (new originally?) file, presumably appending at the end, closing the file after the write.  If Read is true, it tries to read the i-th Waveform.  What if there are less than i writes?

 

Why not simplify things.  Remove the While loop, remove the Case Statements and Read/Write buttons, and simply do one Simulate Signal, one Write, and one Read (not wiring anything into the Read's Record selector).  Does that work?  If so, then think about how you might extend this to handle multiple reads and writes.  Is there ever a situation when you envision doing Reads while you are also doing Writes?  Isn't it more likely that, at any instance, you are going to be doing only Writes (for example, while generating data) or only Reads (while analyzing the saved data)?  [I'm not saying that you might want to do both simultaneously, but if you don't have to, don't complicate things for yourself].

 

Bob Schor

0 Kudos
Message 2 of 2
(2,516 Views)