LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know how to create an Abort/close window button in Vi?

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

0 Kudos
Message 1 of 15
(2,635 Views)

You can use VI server's Abort method to abort the VI. This will kill the VI immediately.

0 Kudos
Message 2 of 15
(2,628 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 15
(2,622 Views)

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.

0 Kudos
Message 4 of 15
(2,618 Views)

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,

0 Kudos
Message 5 of 15
(2,607 Views)

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.

-----

The best solution is the one you find it by yourself
Message 6 of 15
(2,603 Views)

A finished program should never get stuck in a loop. If it happens during development, press the abort button or "Ctrl+."

Message 7 of 15
(2,601 Views)

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.

0 Kudos
Message 8 of 15
(2,596 Views)

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,

0 Kudos
Message 9 of 15
(2,585 Views)

@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.

0 Kudos
Message 10 of 15
(2,571 Views)