LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading multiple VIs Front panel in subpanel of main VI

Solved!
Go to solution

 Hi All,

I want to design a framework to load multiple VI's front panel(One at a time) on main VI
My main VIs has two section
1.Static section-Which consist of common functionality button like Home,Start,Stop.Back etc.
2.Dynamic section-which consist of subpanel which will load multiple sub VI's frontpanel(Only one front panel
at a time)

Now I want to capture events of buttons in static section and accordinly load respective
VI's front panel in subpanel.
additionally loaded vi in subpanel will also have some buttons , and pressing of those
buttons should again load respective VI's front panel in same subpanel.
e.g.
Home button is there in static section.
If I press Homebutton, it will load Home VI in subpanel.
That Home button will again have some button lets consider "Add" button.
Now if i press "Add" button , it should load "Add" VIs front panel in same subpanel and
Home VI's front panel should disappear.
Now "Add" VI's front panel is loaded .
Again if I press "Home" button in static section then it should again load "Home" VI in subpanel.

Which framework and what could be the best possible way of implementing such logic?
can anyone suggest?

0 Kudos
Message 1 of 5
(4,050 Views)

Hi kManaa

 

Check out the Find Examples... in the LabVIEW Help menu and search for "subpanels".  I found an example called Multiple VIs in a Sub Panel that looks to be exactly what you need.

 

Steve

0 Kudos
Message 2 of 5
(4,026 Views)

Hi Steve,

Thanks for your reply.
I have already gone through the example that you reffered. The example has two levels.i.e
1 level- Event on top level Vi , which opens Graph VI in subpanel.
2 level- Events on graph VI.

I need more levels inside i.e . Events in 2nd level VIs (Which will open in
subpanel on top Vi) should again open another subVI(This may be 3rd level)
but at the same time , Top level events should able to close this subVI if event of button.
on top level VI is detected.
e.g.Pressing of Home button should open Home VI in subpanel.Home button is on top level VI.
Subpanel is on Top level VI.
Then there are button on Home VI e.g User,Report,etc.
So Pressing of User button should open User VI in subpanel, pressing of Report should open
Report VI in same subpanel.
These VI should be visible in subpanel area only.And When Report VI is open in subpanel
and if user wants to open Home VI directly. He should be able to directly open it
by pressing Home button which is in static section of Top VI.
In this way , I need some levels inside for multiple Vis to open in single subpanel
on top VI,
So whether this subpanel framework is feasible solution or are there any other best possible
solution for such application because my application may consist of 15 to 17 Vis
which will have GUI.
Kindly suggest.

0 Kudos
Message 3 of 5
(3,813 Views)
Solution
Accepted by topic author kManaa

I need more levels inside i.e . Events in 2nd level VIs (Which will open in
subpanel on top Vi) should again open another subVI(This may be 3rd level) 

 

So you want VIs at second level, to have also subpanels, where you can insert 3rd level subVIs? I never did this, but I imagine it should work.

Regarding to your intercommunication question, I advise to use Dynamic User Events. I would create the UserEvent Refnums at the initialize part of your main, top-level VI, then feed these refnums (bundled up by names using a "UserEvent Refnum" typedef cluster) into a FGV or a global variable (you only want to write once these values to store them).

After this, simply when you start to run a module/subVI, you read out the bundled RefNums from the FGV, and register your Event Structure to capture these Events, fired from other subVIs/toplevel VI. Also, since you have these Refnums, you can fire an Event from anywhere in your VIs. Do not worry about unhandled Events for your Event Structures. So just register your Event Structures for ALL your UserEvents (figure out how many UserEvents you need, and name them logically, like "CMD_Toplevel_to_subVIs", etc...), but create only those dynamic event Cases, which you want to use inside that particular VI. The Event Structure is "intelligent" enough to discard incoming Events which you did not create a Case for. Thus no memory leak...

Message 4 of 5
(3,808 Views)

Thanks Blokk for your reply.

I tried with user events. It is working now.

Thank you very much.  

 

0 Kudos
Message 5 of 5
(3,695 Views)