08-15-2012 06:32 AM
Hello,
I am relatively new to LabVIEW and am using LabVIEW 8.0 and am having a strange problem. My program is laid out such that I have a front panel (A) which opens up a subpanel (B) through a radio control. This subpanel (B) has a button that, when pressed, runs sub-vi C AND displays a sub-panel containing C.vi's real-time graph. In "C", my code uses a Read from Measurement File express VI to read a text file into an array which is essential to the vi and in single iterations of the vi there are no problems whatsoever, HOWEVER if the C.vi is not properly closed and it tries to run again, I receive an "End of File Encountered" error. When I run just B.vi and access C.vi that way, I have coded it to "Close after Call" and wired that VI reference to a Close File.vi. This works successfully as I can repeatedly run C.vi and no errors occur. However, when I start with A.vi and access C.vi through the B.vi subpanel, I can run it successfully the first time but if I try to run it the second time, I receive the "End of File Encountered" error. I'm really not sure what the correct course of action is here as B -> C works fine but A -> B -> C doesn't seem to work even though A doesn't have a single reference to C.vi whatsoever.
Thank you for your time.
Solved! Go to Solution.
08-15-2012 08:05 AM - edited 08-15-2012 08:08 AM
Well that was a bit confusing to read, but my guess is the file pointer is remaining at the end of the file if some sort of file close is not happening correctly when B is run inside A. You said when it is not shut down properly this happens, so all bets are off if the file isn't being closed. My suggestion is make sure the file is being closed properly (make sure you aren't aborting the VI, but instead are sending it a exit message), and if you do not use read from measurement file but instead use the file I/O VIs, there is a VI to set file position. You can set it to "start" every time before you read.
This is just a guess, you may want to post your VI if you can.