Hi Alan,
Your issue is very odd. Looking at your code, there doesn't seem to be anything that could cause the application to stop. Frame 1 and 3 are definitely not able to generate an error that would stop the application, frame 2 SHOULD generate a popup dialog (Simple Error Handler.vi) if a file error was detected. Frame 0 should only give an error if the Front Panel Datasocket connection for the P1 cluster is missing. Even when closing the Datasocket Server or specifying a wrong IP address the VI would continue to run.
Are you by any chance controlling this VI dynamically from another VI (VI Server)? Does the screenshots show all the code of the VI? What value is "wait"?
Even though I can't tell you what stops your specific example, there are certain things I would like to point out:
Why do you specify the Datasocket URL and Mode continuously in the loop? Since you are using Front Panel Datasocket, you should just set it up when configuring the Front Panel Datasocket in the Datasocket Connection dialog box.
There's no need for Local Variables in your VI. Instead of Local Variables, connect to the controls and indicators directly. Convert "IP" to a control and disable it if you don't want the user to be able to change the value. To disable a control, right-click and select "Advanced >> Enabled State >> Disabled".
You are over-writing the same file continuously. Is that the intension or do you want to append to the file?
I look forward to your answers...
- Philip Courtois, Thinkbot Solutions