LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I generate a boolean output whenever I abort a VI?

I have a VI that has a stop button on the front panel.  The way I have the VI setup, some action is taken before the VI ends.  When I click on the stop button the action is exectued before the VI stops running, and then the VI stops running. as expected .  However, when I click on the abort button on the tool bar, the VI stops running, but the action is not executed.  How can I set the VI up so that the action is executed if I click the abort button?  Is there a boolean I can access after the abort button is clicked?  Thanks.
0 Kudos
Message 1 of 33
(3,926 Views)

epsilon-delta wrote: 
... How can I set the VI up so that the action is executed if I click the abort button?  Is there a boolean I can access after the abort button is clicked?  Thanks.

I don't think there is ant way to exectute an action after the abort button is clicked.  By definition, the abort button is stopping the vi.

 

Why don't you make your own abort button (boolean) and use an event structure to capture the abort action?  Then, you could execute any cleanup code and terminate the program.

Message Edited by vt92 on 04-21-2009 11:23 AM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 33
(3,922 Views)

Clicking on the Abort button should not even be an option for your program! Remove it. This is done in VI Properties>Window Appearance>Customize.

 

See this.

0 Kudos
Message 3 of 33
(3,914 Views)
Yes.  That's a good idea.  Thanks.
0 Kudos
Message 4 of 33
(3,899 Views)

I have a similar issue, but this post doesn't answer it completely, therefore I intervene here by answering last post s reply:

 

.. indeed one can suppress abort s option. But that wont prevent the user from aborting the vi in another way, for example just by closing Labview or it s process.

My concern is to make a test bench very secure:  tests launched during its use will deliver

high voltage on the bench. Therefore I want to make sure any cancelation of the VI also sets the concerned supplies back to 0V.

Would there be any mean to associate VI s cancellation with an scripted action ( in this case

shutting down power supplies outputs )

 

Thanks in advance for your answer.

Charles. 

0 Kudos
Message 5 of 33
(2,988 Views)

@CharlesDel wrote:

I have a similar issue, but this post doesn't answer it completely, therefore I intervene here by answering last post s reply:

 

.. indeed one can suppress abort s option. But that wont prevent the user from aborting the vi in another way, for example just by closing Labview or it s process.

My concern is to make a test bench very secure:  tests launched during its use will deliver

high voltage on the bench. Therefore I want to make sure any cancelation of the VI also sets the concerned supplies back to 0V.

Would there be any mean to associate VI s cancellation with an scripted action ( in this case shutting down power supplies outputs )


Why not make sure the VI can't be aborted?

 

You can get notified if a VI aborts, by allocating a queue A before you start the VI, then make the VI allocate a queue B, pass queue B on Queue A. The starter of the (dynamic) VI will then get queue B, and can wait for a enqueued element. But the wait will also stop if the VI that allocated the queue B terminated. So when the VI stops in any way, the caller gets notified...

0 Kudos
Message 6 of 33
(2,985 Views)

BTW. this is an 11 year old thread...

0 Kudos
Message 7 of 33
(2,983 Views)

Closing LV or a window will generate an App.close and window.Close-event resp. That can easily be handled.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 33
(2,978 Views)

@CharlesDel wrote:

.. indeed one can suppress abort s option. But that wont prevent the user from aborting the vi in another way, for example just by closing Labview or it s process.


If you terminate the process, the process won't have any way to react...

Message 9 of 33
(2,973 Views)

wiebe@CARYA wrote:

@CharlesDel wrote:

I have a similar issue, but this post doesn't answer it completely, therefore I intervene here by answering last post s reply:

 

.. indeed one can suppress abort s option. But that wont prevent the user from aborting the vi in another way, for example just by closing Labview or it s process.

My concern is to make a test bench very secure:  tests launched during its use will deliver

high voltage on the bench. Therefore I want to make sure any cancelation of the VI also sets the concerned supplies back to 0V.

Would there be any mean to associate VI s cancellation with an scripted action ( in this case shutting down power supplies outputs )


Why not make sure the VI can't be aborted?


If it is very critical that the software won't stop, use a fine tuned Linux distribution, or Windows IoT, or even a real time system (cRIO). You can tweak normal Windows so you're not allowed to use task manager anymore, nut who knows what happens when Windows updates? 

 

If things are that important, the hardware should handle it. When software is unresponsive the hardware should bring the system to a safe state.

0 Kudos
Message 10 of 33
(2,968 Views)