11-24-2009 08:45 AM
johnsold wrote:Ravens Fan,
I think you are right. I was thinking of "Application Instance Close?" and the "Panel Close?" rather than abort. I did not have LV open to check.
Lynn
Lynn,
grrrr... I was searching for this event about 20 mins now!!!
11-24-2009 09:59 AM
Vsh wrote:
There is really no use of (or point in) showing Abort button to the user as it is solely meant for debugging, only and only a developer of the vi must have access to it! and no other.
I think this hit the nail on the head. Use the event structure to capture the Application Instance Close and Panel Close events as well as your stop button. In your running application there is no reason to show the standard buttons you see in the development mode. They don't make much sense in a running application.
11-24-2009 12:57 PM
I can't find the link right now but an often quoted LabVIEW saying is: "Stopping your vi with the Abort button is like stopping your car by running into a tree. It WILL work but, there may be consequences."
For any rugged application you do want to capture the "Panel close?" event, (optionally prompt the user to confirm) run cleanup code (optimally setting cursor busy or pop-up a "Closing app" Dialog,) Then stop the vi. hopefully the VI properties are set to close front panel or the caller is set to close it programatically.
11-24-2009 01:51 PM
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
You can find it in the signature from Ed Dickens
11-25-2009 03:18 AM
Vsh: There even exists a picture (with a car stopped by a tree) with this saying. 10 min searching but I didn't find it. If anyone has bookmarked it: please post the link.
It consider it very educational to new users not to rely on that button at all.
Felix
11-25-2009 05:00 AM
F. Schubert wrote:[...]There even exists a picture (with a car stopped by a tree)[...]
Anyone can create this on his/her own. Simply download a picture of a car which crashed against a tree and here you go.....
Norbert (who has made such an image as background image for his laptop)
11-25-2009 08:59 AM - edited 11-25-2009 09:01 AM
A typical necessity for a "hard" abort is when your program becomes locked up in an infinite loop, which you may have encountered due to an ill-placed dialog box - being accessed continuously. This is a case where you need to Abort, but the abort button (or Control+Period) don't work.
Someone wrote a VI which will allow you to Abort such VI's, but it has a protected block diagram. I regret to say I've forgotten who supplied this VI, because they deserve credit. I bet many of you have it and may know the author. I wonder how it works?
The VI is attached.
11-25-2009 09:26 AM
Broken Arrow: If my memory serves, the Abort Vi was posted as a nugget from Darren. It is password protected because of the code that accesses your VI is based on private properties/scripting properties. I don't know wether these are released under the scripting 'license', so they could be made public.
Felix
11-25-2009 09:40 AM
F. Schubert wrote:Broken Arrow: If my memory serves, the Abort Vi was posted as a nugget from Darren. It is password protected because of the code that accesses your VI is based on private properties/scripting properties. I don't know wether these are released under the scripting 'license', so they could be made public.
Felix
Some things are better left private.
11-25-2009 09:44 AM
There is no need for scripting except i am overlooking some rather special cases where VIs running as top level VIs must not be aborted the hard way.
Nevertheless: It is not recommended to implement something like the attached VI and i hope that nobody is going to abuse it....
And everyone please always remember the CAR and the TREE!
Norbert
PS: I have seen severe hardware damage because some "inguine developer" was used to terminate his applications always by pressing the "Abort Execution" Button on the VIs.......