08-06-2012 05:23 AM
Hi,
I am designing a GUI in which I am calling pultiple Sub VIs. I want to generate panel close? event of Sub vi's from the main VI. Can I do that??
Solved! Go to Solution.
08-06-2012 06:13 AM
You need to use event structure for that.
08-06-2012 06:20 AM
08-06-2012 06:25 AM - edited 08-06-2012 06:26 AM
08-06-2012 06:36 AM
Panel close is a UI event and it for my knowledge it cannot be simply triggered from another main VI.
May be you can trigger user events from one vi to other...
what is the necessity for this logic?
08-06-2012 06:41 AM
@SC. wrote:
Hi,
I am designing a GUI in which I am calling pultiple Sub VIs. I want to generate panel close? event of Sub vi's from the main VI. Can I do that??
You want to close the sub vi from the main vi? is the front panel of the sub vi opened during execution? how are you calling the sub vi? is it a dialog box? or, are you showing the front panel of the sub vi using application nodes?
why do you want to generate the 'panel close?' event? is it ok to close the FP of the sub vi using a 'close' button or something like that?
or, you can use stop the execution of the sub vi and close its front panel using application nodes, given that you have the vi reference for your sub vi.
let us know your exact application and requirement. may be post the source code if it is ok.
08-06-2012 07:17 AM
HI Freelance LV
The front panel of SubvI is opened during execution by run time menu.
I am designing this program for a group of user who are not familiar with Labview functioning. So I have to keep the desing like standard window applications. in which user can close individual vis by their panel close.
I also want to give another flexibility that if he closes main vi front panel he need not close individual subvis panels.
I tried FPclose but it did not close vi it just closes the front panel.
I have posted the image of source code. individual VI's will be called I want to close them individually as well as programattically.
08-06-2012 07:44 AM
@Aojha wrote:
HI Freelance LV
The front panel of SubvI is opened during execution by run time menu.
I am designing this program for a group of user who are not familiar with Labview functioning. So I have to keep the desing like standard window applications. in which user can close individual vis by their panel close.
I also want to give another flexibility that if he closes main vi front panel he need not close individual subvis panels.
I tried FPclose but it did not close vi it just closes the front panel.
I have posted the image of source code. individual VI's will be called I want to close them individually as well as programattically.
In that case, you can use a standard global variable, notifier, queue or FGV to communicate to all sub VIs that they need to close and handle whatever needs handling in them when the main VI is closed. Each sub VI can also handle their own Panel Close event in an Event Structure.
08-06-2012 07:46 AM
Hi ,
Create a boolean global.
Use this global also in the STOP condition of all the subvis.When the stop control is issued,make this boolean true and all the other subvis too will stop.
However , from your code snap , it appears that the Main vi wont open other subvis if one subvi is open and running.You must launch the other subvis dynamically using vi server.
08-06-2012 10:38 AM
You can use NI's Windows utility to close any window (not limited to LabVIEW windows):
http://zone.ni.com/devzone/cda/epd/p/id/4935
Many other features. It's a free download.