LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show hidden controls when vi stops running ?

I hide some controls during running of a vi. In the LV development
environment, when that vi stops running, I'd like all hidden controls
to become visible again so I can see them in order to continue
editing.

I'm using an event structure inside a While Loop which is terminated
with a Stop button. By passing True from inside the While Loop to a
Visible property for each control outside the While Loop, they can be
made to reappear when the vi stops. I don't really wish to have a
Stop button though since a compiled version would show it leading to
display of the LV window when they click it. I don't want to move it
off screen to hide it from them since I'd have to then find it when in
the LV editor mode.

Is there a "VI stop
ping" event or similar that can be used to set the
visible property of controls before it closes or someway to make them
visible if the vi is stopped using the red Abort Execution button on
LV's toolbar ?
0 Kudos
Message 1 of 7
(3,330 Views)
Here's what I do:

Move the control off the screen so that users can't click on it. Then assign a "secret" keystroke to the stop button using Key Navigation. Make sure its something difficult like CONTROL-ALT-F3. Then in development mode you can easily hit CONTROL-ALT-F3 to stop the app and make all the controls visible. And then just before distribution you can remove Key Navigation if desired.
http://www.medicollector.com
0 Kudos
Message 2 of 7
(3,330 Views)
Quick note:

When I say "move the control off the screen" I mean "move the STOP BUTTON off the screen".

Or you could just hide it behind something.
http://www.medicollector.com
0 Kudos
Message 3 of 7
(3,330 Views)
Since you're already using an event structure, the visible properties should be placed inside there - no need to place them outside unless you're doing some cleanup after the stop button is clicked. I don't understand your comment about not wanting a stop button because it "would show it leading to display of the LV window when they click it". Could you explain what you mean. You really should use a stop button and not allow the user to user the abort button. Bad things can happen with the abort button. It's a debug tool and not the correct way to stop a program. It's easy to disable the thing - VI Properties>Window Appearance>Customize and uncheck Show Abort Button.
0 Kudos
Message 4 of 7
(3,330 Views)
A While loop is around the event structure with the Stop button wired
to the While loop. During execution, some controlls are hidden
depending on what the program is doing. When the program stops, I
want all controls to be visible again so when back in the LV editor
mode, I can see them and edit them. So the reset to visible
properties are outside the while loop but they do not get reset if the
abort button is pressed to stop the program.

Ultimately, this is compiled to a stand-alone application. If a Stop
button is present, this leaves the application window visible with
some LV menus visible when it is used to stop the app. The toolbar
with Abort button is not shown in the stand-alone app - they just
click the X on the window to stop the app.

On
Fri, 12 Sep 2003 07:47:51 -0500 (CDT), Dennis Knutson
wrote:

>Since you're already using an event structure, the visible properties
>should be placed inside there - no need to place them outside unless
>you're doing some cleanup after the stop button is clicked. I don't
>understand your comment about not wanting a stop button because it
>"would show it leading to display of the LV window when they click
>it". Could you explain what you mean. You really should use a stop
>button and not allow the user to user the abort button. Bad things can
>happen with the abort button. It's a debug tool and not the correct
>way to stop a program. It's easy to disable the thing - VI
>Properties>Window Appearance>Customize and uncheck Show Abort Button.
0 Kudos
Message 5 of 7
(3,330 Views)
The way it should be done is to call the Exit LabVIEW function as the very last thing and then the window will close by itself. I would hope that you're trapping the X button with the event structure so that you can get a controlled stop. That way, if it's clicked, you can prompt the operator and ask "Are you sure you want to quit?" if you want but at the very least, close all references, etc. before closing the program. You can have the Exit LabVIEW function in your debug code and use the property Application:Kind. It returns Development System or Runtime system, etc. and it's easy to put the Exit LabVIEW inside a case structure.
0 Kudos
Message 6 of 7
(3,330 Views)
Thanks for the App.Kind tip Dennis.

I'm cursious about the Help on Open.Application.refernce > machine
name :

"If you want to establish communication between a VI and a stand-alone
LabVIEW application on the same computer,
wire localhost to this input. localhost establishes communication with
the LabVIEW Run-Time Engine. "

Why wire "localhost" vs just leaving it unwired ? I didn't always get
localhost to work properly.

Steve
0 Kudos
Message 7 of 7
(3,330 Views)