LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One subpanel - multiple subVIs

Hi,
I have, in my top-level VI, a user menu linked to a select case. Each case calls one or more subVIs. In one case, I call for subVI_1 and displays it on a subpanel which is on the front panel of the main VI. In an other case, I call for subVI_2 and, as 1 and 2 can't be executing at the same time, I'd like to display subVI_2 on the same supanel as subVI_1, but I did not find how. Is it possible? Thanks a lot.

Philippe
Message 1 of 9
(4,019 Views)
You cannot have two vi front panels in one Sub-panel at least I do not of anyway to do it. I ther a reason you do not want both vi's to show when called.

Hope this helps

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 9
(4,019 Views)
Hello!

If I understood correctly, you call different subVIs depending on what case of your case structure is being executed. If this is correct, you can use the same subpanel to show the front panel of the subVI that is being called.

In the same way you Open a VI Reference, set the Run VI Invoke Node, use the Invoke Method and Close the Reference for one of the subVIs in one case, you have to do the same in all the other cases. The only thing that will be changing is the path to the subVI that you want to show in the subpanel depending on the case the user selects.

I am including a simple example to show you what I mean.

Hope this helps!

S Vences
Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(4,019 Views)
Philippe,

It is possible. I have an application that switch between several VIs back an forth in a subpanel. Here is how I do it.
-Open VI 1 ref
-Invoke Run method on VI 1(do not wait for completion true, and autodispose ref set to false)
-Insert VI 1 in subpanel
-Upon user event invoke remove VI 1 (keep ref open [in an lv2 style intelligent global for example] so you wont need to reopen it later if you need to go back to that particular VI)
-Open VI 2 ref
-Invoke Run method on VI 2(do not wait for completion true)
-Insert VI 2 in subpanel
...

Hope it help

PJM


  


vipm.io | jki.net

Message 4 of 9
(4,019 Views)
I was under the impression that you wanted them displayed at the same time in the same sub panel.You have them display at different times just like PJM states.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 9
(4,019 Views)
I have looked at the methods list of the VI's invoke node but can not find the remove VI as suggested here by PJM. Howz this done?? Many thanks all.
0 Kudos
Message 6 of 9
(4,019 Views)
Found it in the subpanel methods list, Thanks
0 Kudos
Message 7 of 9
(4,020 Views)

Hi,

The example shows the case when you have multiple VIs to be dispalyed in subpanel when they are not running simultaneously. I have two Vis which run simulataneously and I need to display their front panel in a subpanel of main VI depending upon the user selection. Does any one know how to do it?

Thanks,

0 Kudos
Message 8 of 9
(3,636 Views)
Perhaps you could use a Tab control with two pages. Put a subpanel on each page of the Tab control, and then you can easily switch between the two VIs running in the subpanels.

Mark.
0 Kudos
Message 9 of 9
(3,618 Views)