LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can one build a VI to execute a function or functions when a user clicks the hexagonal stop sign to stop the VI?

I have a front panel stop button that works just fine for my purposes... but there's also the issue of the hexagonal stop sign that if clicked, cuts the VI off no matter where it is in execution.
It is imperative that this VI be allowed to execute clean up functions before it is killed. Is there a way to do this? Or do I just need to tape a note to the monitor saying "DO NOT CLICK THE HEXAGONAL RED STOP SIGN!!!"

Ideas would be great,
Jim
0 Kudos
Message 1 of 9
(3,280 Views)
The best way to do this is to not make the stop sign visible. In LabVIEW 6, go to VI Properties>Window Appearance>Customize and unselect either "Show Toolbar When Running" to disable the whole toolbar or just "Show Abort Button".
0 Kudos
Message 2 of 9
(3,280 Views)
As far as I know, the abort button acts at the lowest level and no operation is possible after it has been clicked.
That's why I always hide it in my applications, the way Dennis Knutson has explained in the previous answer.
0 Kudos
Message 3 of 9
(3,280 Views)
But make sure the code works before hiding it- only hide after testing the
complete program 🙂

alberto wrote in message
news:506500000005000000022D0000-991728092000@quiq.com...
> As far as I know, the abort button acts at the lowest level and no
> operation is possible after it has been clicked.
> That's why I always hide it in my applications, the way Dennis Knutson
> has explained in the previous answer.
0 Kudos
Message 4 of 9
(3,280 Views)
No problem, you can use ctrl+. to stop the vi execution.
0 Kudos
Message 5 of 9
(3,280 Views)
Clarification; there are two ways you can prevent the program being aborted.
The first is to unselect "Show toolbar when running" whilst leaving "Show
Abort Button" selected. Here ctrl and . work to abort the program. If I'm
doing this, I generally also unselect "Show Abort Button" in which case the
key combination is also disabled.

If you're wanting to prevent aborts, allowing ctrl . isn't much use.

Gorka Larrea wrote in message
news:5065000000050000000B2D0000-991728092000@quiq.com...
> No problem, you can use ctrl+. to stop the vi execution.
0 Kudos
Message 6 of 9
(3,280 Views)
Sorry, i was talking in the case you only unselect "show toolbar", in which case the abort button won't show when running, but ctrl+. will work, at least in LV 5... thanks for the correction indeed.
0 Kudos
Message 7 of 9
(3,280 Views)
I typically have a special "stop" button that I keymapped to a special key. This button (with the keymap) is hidden from the front panel so the user cannot see it but the keymap will still function. Thus, you can hide the LabVIEW Abort button but still have a safe way of terminating your application.

I hope that helps.

Shan Pin Koh
Systems Engineer
Oakriver Technology
0 Kudos
Message 8 of 9
(3,280 Views)
Wow, thanks for all the input everyone!
0 Kudos
Message 9 of 9
(3,280 Views)