03-03-2020 02:55 AM
Hi,
I have some parallels loop feed with a queue. I have a button to start reading a txt file and send it to some display.
The problem is that after some time I get the error:
"LabVIEW: (Hex 0x4) End of file encountered.
=========================
Invalid argument or arguments to function call."
I use the queue status to stop this loop. Any ideas on how to solve this issue?
Thank you
Solved! Go to Solution.
03-03-2020 03:01 AM
Hi PM,
@PMSilva wrote:
The problem is that after some time I get the error:
"LabVIEW: (Hex 0x4) End of file encountered.
I use the queue status to stop this loop. Any ideas on how to solve this issue?
Why is it a problem to get the error message "EOF encountered" when you are trying to read past the end of the file?
How is this related to the queue status?
What exactly is "the issue"?
03-03-2020 04:56 AM
I have the main program that is reading some data from CAN.
I have a parallel loop that I can enable to store the data in a txt file.
However, I want to add a feature to use the same program to replay the data logged into the txt file. So i need to figure out to have no error when I get the EOL. Can I search if I am at the EOL and point again to the start of the txt file and make like a loop. The question is... When I close or stop the application, do I need to perform the Close file?
03-03-2020 05:13 AM
Hi PM,
@PMSilva wrote:
So i need to figure out to have no error when I get the EOL. Can I search if I am at the EOL and point again to the start of the txt file and make like a loop.
You don't need to "figure out to have no error" - you need to "figure out how to handle that error"!
Suggestion:
IF error THEN SetFilePos(Start)
Looks rather simple: check for EOL error and set fileposition back to start…
@PMSilva wrote:
The question is... When I close or stop the application, do I need to perform the Close file?
How is this related to your EOF problem?
You should close all references (including file references) before stopping your executable…
03-18-2020 07:22 AM
Indeed...
I remove the Close Reference outside the loop that reads each line, and the program when i get the EOL starts reading again the file. With this i can handle it... and make some other changes.
Thank you for the help.