LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating panel close programmatically

Solved!
Go to solution

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??

Labview user
0 Kudos
Message 1 of 15
(6,651 Views)

You need to use event structure for that.

0 Kudos
Message 2 of 15
(6,643 Views)

You need to get a reference to the sub VIs and invoke the FP Close method.

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 15
(6,640 Views)

The problem with my answer is that it won't execute the Panel Closed event, so nevermind.  Smiley Embarassed

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 15
(6,637 Views)

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?

0 Kudos
Message 5 of 15
(6,631 Views)

@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.


 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 6 of 15
(6,629 Views)

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.

Labview user
0 Kudos
Message 7 of 15
(6,622 Views)

@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.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 15
(6,618 Views)

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.

0 Kudos
Message 9 of 15
(6,617 Views)

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.

 

 

George Zou
0 Kudos
Message 10 of 15
(6,601 Views)