LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about subvi front panel

I want to call a subvi in the main program and do like
this:
1. When the main program calls the subvi, the subvi shows its front
panel and executes.
2. After the subvi finishes, it can close the front panel.

Now, I meet a problem: I can popup the subvi node setup dialog to enable
"show front panel when called", which implements the first one, but I
can not close the front panel until originally closed(main
program stops). How can I close the subvi's front panel(after it
finishes running) even when the main program is still running?

Thanks in advances.




Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 1 of 6
(3,449 Views)
zhljh@my-deja.com wrote:

> Now, I meet a problem: I can popup the subvi node setup dialog to enable
> "show front panel when called", which implements the first one, but I
> can not close the front panel until originally closed(main
> program stops). How can I close the subvi's front panel(after it
> finishes running) even when the main program is still running?

Select the "close front panel if originally closed" option.
in addition to the "Show front panel when called"

Kevin Kent
0 Kudos
Message 2 of 6
(3,449 Views)
In article <38E138DB.2A27164A@usa.alcatel.com>,
"Kevin B. Kent" wrote:
> zhljh@my-deja.com wrote:
>
> > Now, I meet a problem: I can popup the subvi node setup dialog to
enable
> > "show front panel when called", which implements the first one, but
I
> > can not close the front panel until originally closed(main
> > program stops). How can I close the subvi's front panel(after it
> > finishes running) even when the main program is still running?




> Select the "close front panel if originally closed" option.
> in addition to the "Show front panel when called"
>
> Kevin Kent


I have tried this, in this way, the subvi's front panel is closed only
after the main program stops. In fact, what I want is to close the
subvi's front
panel even the main program is still running.


zhljh


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 3 of 6
(3,449 Views)
zhljh@my-deja.com wrote in message <8brnmh$dlg$1@nnrp1.deja.com>...
>In article <38E138DB.2A27164A@usa.alcatel.com>,
>"Kevin B. Kent" wrote:
>> zhljh@my-deja.com wrote:
>>
>> > Now, I meet a problem: I can popup the subvi node setup dialog to
>enable
>> > "show front panel when called", which implements the first one, but
>I
>> > can not close the front panel until originally closed(main
>> > program stops). How can I close the subvi's front panel(after it
>> > finishes running) even when the main program is still running?
>
>
>
>
>> Select the "close front panel if originally closed" option.
>> in addition to the "Show front panel when called"
>>
>> Kevin Kent
>
>
>I have tried this, in this way, the subvi's front panel i
s closed only
>after the main program stops. In fact, what I want is to close the
>subvi's front panel even the main program is still running.
>
>
>zhljh
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

Another option would be to open a VI reference (found under "application
control") and tie that to a property node and select the property "front
panel.open". Change it to a control and attach a boolean false to it when
you like to close.

RB.
0 Kudos
Message 4 of 6
(3,449 Views)
In article <954328830.573287@dibbs3.eur.cis.philips.com>,
"Remco Breen" wrote:
>
> zhljh@my-deja.com wrote in message <8brnmh$dlg$1@nnrp1.deja.com>...
> >In article <38E138DB.2A27164A@usa.alcatel.com>,
> >"Kevin B. Kent" wrote:
> >> zhljh@my-deja.com wrote:
> >>
> >> > Now, I meet a problem: I can popup the subvi node setup dialog to
> >enable
> >> > "show front panel when called", which implements the first one,
but
> >I
> >> > can not close the front panel until originally closed(main
> >> > program stops). How can I close the subvi's front panel(after it
> >> > finishes running) even when the main program is still running?
> >
> >
> >
> >
> >> Select the "close front panel if originally closed" option.
> >> in addition to the "Show front panel when called"
> >>
> >> Kevin Kent
> >
> >
> >I have tried this, in this way, the subvi's front panel is closed
only
> >after the main program stops. In fact, what I want is to close the
> >subvi's front panel even the main program is still running.
> >
> >
> >zhljh
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
>
> Another option would be to open a VI reference (found under
"application
> control") and tie that to a property node and select the property
"front
> panel.open". Change it to a control and attach a boolean false to it
when
> you like to close.
>
> RB.
>
I think a more elegant way of closing the SUB VI is to start off the way
that Remco states regarding opening a VI reference. Only in the Sub VI,
you should program a Terminate control (such as an Abort button to exit
from a While loop... or something similar) and via the VI reference,
select the 'Set Control Value' method to gracefully stop the Sub VI
execution. Of course the Sub VI will have to set the close if originally
closed attrib set.
There is a great source of example LabVIEW apps at:
http://digital.ni.com/explprog.nsf/web%2Fswgrp?OpenView&Start=1&Count=50
0&Expand=3.7#3.7
In particular, see "Stopping a Running SubVI from the Main VI Using VI
Server" example. It demostrates this techniques better than I can
explain it. Hope this help.
Rick


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 5 of 6
(3,447 Views)
>
> I have tried this, in this way, the subvi's front panel is closed only
> after the main program stops. In fact, what I want is to close the
> subvi's front panel even the main program is still running.
>

that's where the "if originally closed" part comes in... If you want the
panel to close when it's VI ends, . If you've been programming the subvi,
(e.g.--the file is open)you have to close it before the calling VI calls it.

One thing to beware of in this is that opening/closing windows takes a fair
bit of system resources, and will slow down your execution significantly if
you do much of it.....
0 Kudos
Message 6 of 6
(3,440 Views)