09-25-2012 11:21 AM
Hello,
Is there a way to close a Vi during execution even while it's in a loop? Kind of like an Abort button...
Thanks
09-25-2012 11:26 AM
You can use VI server's Abort method to abort the VI. This will kill the VI immediately.
09-25-2012 11:38 AM
I should mention the disclosure that this is not the desired way to stop a VI's execution. A VI should be able to run to completion and close out everything.
Maybe what you really need is a way of messaging a VI to stop looping and close out?
09-25-2012 11:50 AM
Your question contains mixed messages, because "close" and "abort" are sometimes two completely different things.
For example, there is the [X] in the upper right corner, which will close the front panel, but not stop the VI.
It seems you are looking in the wrong place. Can you explain exactly what you need to do? There are probably better solutions.
09-25-2012 01:01 PM
Hello,
I want to have the ability to close the Vi (like th window's X button) while its executing. For example, if the program gets stuck in a loop.
Thanks,
09-25-2012 01:09 PM
I would suggest you to make the changes to avoid the functions which hangs the loop instead of going for abort. If you have handled everything properly then it not get hung unless your other application on the PC gives trouble or anyother windows issue.
09-25-2012 01:09 PM
A finished program should never get stuck in a loop. If it happens during development, press the abort button or "Ctrl+."
09-25-2012 01:15 PM
Perhaps you could identify the conditions of a loop hang, or the symptoms of a loop hang and test for those conditions inside the loop?
If it is left to user judgement, couldn't you just place an abort button inside the loop and whenever the user presses the button a loop break occures? You can also wire error terminals to loop conditionals, because if something is going wrong it seems appropriate for an error to be generated by one of the VIs inside the loop.
09-25-2012 01:44 PM
Hello,
When a program is compiled and a user starts the program I have watchdog functions that can stop the program or wait, however, once the program is stopped, I can't restart it using my start button. I have to close and reopen the window. I figured if I install an abort button it will be easier than a user trying to figure out why it won't run after it's been stopped.
Thanks,
09-25-2012 03:15 PM
@floresma wrote:
I figured if I install an abort button it will be easier than a user trying to figure out why it won't run after it's been stopped.
Once the program is stopeed, an abort button will no longer respond. Please clarify.