LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Abort Button

I'm Craeting a Hardware Interface API and providing my customer easy tools to use LabVIEW. Note that my customer is not an expert in LabVIEW and they tend to use Express VIs and Abort Buttons frequently. 

 

I'm making my own express VI using the Hardware API and it works fine for me. I need to know if there is any way that I can detect  that the top level Aplication program (made by the customer) is aborted by pressing the abort button, so that I can close my device referance gracefully, and it opens properly next time. (presently If I press abort, I need to unplug the device before using next time).

 

I checked this -

How to detect Front Panel ToolBar Abort Button? - NI Community

 

But not much help.

 

I tried to explain techanicality to my customer, but the counter argument I got is that the same behaviour works with NI DAQ. If we abort, it will still work properly next time.

 

Any help will be appreciated. 

0 Kudos
Message 1 of 19
(1,837 Views)

@meBaga wrote:

I'm Craeting a Hardware Interface API and providing my customer easy tools to use LabVIEW. Note that my customer is not an expert in LabVIEW and they tend to use Express VIs and Abort Buttons frequently. 

 

I'm making my own express VI using the Hardware API and it works fine for me. I need to know if there is any way that I can detect  that the top level Aplication program (made by the customer) is aborted by pressing the abort button, so that I can close my device referance gracefully, and it opens properly next time. (presently If I press abort, I need to unplug the device before using next time).

 

I checked this -

How to detect Front Panel ToolBar Abort Button? - NI Community

 

But not much help.

 

I tried to explain techanicality to my customer, but the counter argument I got is that the same behaviour works with NI DAQ. If we abort, it will still work properly next time.

 

Any help will be appreciated. 


Counter that by saying that using the abort button is a highly discouraged LabVIEW practice and you will not cannot provide support for your software if this is a requirement.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 19
(1,809 Views)

If you can't persuade them from not doing the thing that's bad for them...

 

Prevent them!

 
 

(As mentioned in the linked thread, you can remove the Abort button from the toolbar and provide them a safer way to stop).

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 19
(1,804 Views)

@Kevin_Price wrote:

If you can't persuade them from not doing the thing that's bad for them...

 

Prevent them!

 
 

(As mentioned in the linked thread, you can remove the Abort button from the toolbar and provide them a safer way to stop).

 

 

-Kevin P


This would not solve his problem because I believe he is supplying a library and the client is in control of the top level VI.

 

You could always tell your customer that using the abort button is the same thing as stopping your car by running into a brick wall. It works, but the outcome is certainly not desirable.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 4 of 19
(1,779 Views)

AFAIK there is no way to do what you're asking. Which is why everyone is trying to convince you, to convince your customer, to not click the abort button.

 

What would even detect the abort button click if everything stops when you press it?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 5 of 19
(1,771 Views)

@meBaga wrote:

 

I tried to explain techanicality to my customer, but the counter argument I got is that the same behaviour works with NI DAQ. If we abort, it will still work properly next time.

 

Any help will be appreciated. 


Try explaining it this way...

 

You are a passenger in a car traveling 60 MPH and you tell the driver to stop.

 

Pressing the Stop button:

  1. The driver presses the break.
  2. Allows the car to come to a complete stop
  3. Puts it in park
  4. Turns off the engine
  5. Gets out of the car.

Pressing the Abort button:

  1. The driver just opens the door and bails out at 60 MPH 

What car would you rather be riding in?

 

Honestly I don't think there is much you can do. Except try to implore them that they should not be running in the development environment anyway. If they were running a compiled executable you could hide the abort button and catch the "panel close" event and do a proper shutdown if they just closed the program.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 19
(1,760 Views)

@RTSLVU wrote:

 

Except try to implore them that they should not be running in the development environment anyway.


This is the real question that needs answered. Why are they running this in the Development Environment and not a exeuteable? Or does the EXE have the Abort button being shown?

0 Kudos
Message 7 of 19
(1,753 Views)

@Mark_Yedinak wrote:

@Kevin_Price wrote:

If you can't persuade them from not doing the thing that's bad for them...

 

Prevent them!

 
 

(As mentioned in the linked thread, you can remove the Abort button from the toolbar and provide them a safer way to stop).

 

 

-Kevin P


This would not solve his problem because I believe he is supplying a library and the client is in control of the top level VI.

 

You could always tell your customer that using the abort button is the same thing as stopping your car by running into a brick wall. It works, but the outcome is certainly not desirable.


You could obtain a reference to their vi and take the abort button off of their tool bar. A bit malicious but it forces them to not use the abort button. I'm not sure that it would fix your problem, though, as they would likely just program in a new abort button.

 

On a more serious note, could you make your application run asynchronously and check when the caller vi stops running? The vi that you make open for them to call would just be a wrapper to call and forget your asynchronous vi. You could give your asynchronous vi a reference to the calling wrapper, and let the wrapper run until they abort. It would be easy enough to provide functionality for proper shutdown later. It's not ideal (would be better if they would follow reasonable programming practices), but it might be a workaround.

0 Kudos
Message 8 of 19
(1,744 Views)

@Eric1977 wrote:

@RTSLVU wrote:

 

Except try to implore them that they should not be running in the development environment anyway.


This is the real question that needs answered. Why are they running this in the Development Environment and not a exeuteable? Or does the EXE have the Abort button being shown?


Anecdotally, in its early years, LabVIEW didn't have the option of creating an executable.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 19
(1,712 Views)

@billko wrote:

@Eric1977 wrote:

@RTSLVU wrote:

 

Except try to implore them that they should not be running in the development environment anyway.


This is the real question that needs answered. Why are they running this in the Development Environment and not a exeuteable? Or does the EXE have the Abort button being shown?


Anecdotally, in its early years, LabVIEW didn't have the option of creating an executable.


And I had to install it from floppy disks. I remember prompts like "Please insert disk 15 or 20". Those were the days. Can't forget no undo either.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 10 of 19
(1,707 Views)