LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting front panel of subVI to calling VI

Is there a way to "export" the front panel of a subVI so that it becomes part of the (or a pane of) the calling VI? If so, what is it called? I don't know the right language to search for examples of this concept.
 
My problem is as follows:--
 
I built a nice, classy interface to a test program that allows the user a great deal of flexibility in controlling the parameters of the device under test and in seeing the impact of those parameters on other parameters. This has about 8-12 control objects, some of which are also wired to act as indicators so that changing one can display on another and vice versa. This interface and its supporting program is big enough that it belongs in its own subVI rather than in the main program. In addition, I built another interface that charts signals from the device under test; this is also big enough that it belongs in its own subVI.
 
I would like to have the front panels of both of these VIs be part of the front panel of the main program. That is, the front panel of the main program should "inherit" the front panel of each subVI wholesale. If I need to tweak the interface of one of the subVIs -- for example, to add, delete, or replace controls, indicators, displays, charts, etc. -- I would like to be able to do this without having to wrestle with the main VI and the connector pane between it and the subVI.
 
It seems that LabView should be capable of this, but I cannot find any help, guidance, pointers, etc., in the documentation, textbooks, or examples.
 
Could someone give me a clue?
 
Thanks,
 
Hugh Lauer
0 Kudos
Message 1 of 4
(2,733 Views)
The LV technique you're looking for is called "Subpanels".

You place a subpanel container on the FP of the main VI and use the subpanel methods to load and unload the FP of another VI.

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 4
(2,725 Views)

So I tried to configure a subpanel, and found it very confusing. It seems that when you put a subpanel control on the front panel, you have to then set up a way to invoke the subVI. Since my subVI has some inputs and outputs on its connector pane, I created a VI reference for it and wired that to the type specifier node of the Open VI Reference node. I then inserted a Call VI by Reference node, so that I could wire up the inputs and outputs of my subVI. Finally, I wired this to the subpanel Invoke Method (Insert VI).

This is different from the examples I found. In those cases, the subVIs had no inputs or outputs on their connector panes, but rather took all of their information from their front panels.

I got different behavior on different attempts to run it. The most common (and most recent) behavior is that the subVI front panel opens up a few seconds after the main VI starts, but it is not quite "in" the subpanel. Instead, it is offset about an inch from both the top and left, as if it were a floating window that I cannot move. Also, it has annoying scroll bars on the bottom and right, which I don't want.

Incidentally, I have two of these subVIs, and I have not yet tried to put the second one into a subpanel.

What I would really like to do is

  • have both subVIs populate their respective subpanels as soon as the main VI starts, but before any work gets done.
  • after both subpanels are loaded, run the two subVIs in parallel, one to control the device under test and the other to capture its signals.
  • have no scrollbars in the subpanel windows.

In fact, what would be the best from a GUI point of view is for the two subpanels to be permanently part of the front panel of the main VI.

Any guidance or insight would be most helpful.

 

REgards,

Hugh

0 Kudos
Message 3 of 4
(2,710 Views)
You're referring to a number of different issues here, so let's try to break them down one at a time:
  • Scrollbars in the subpanel: This is controlled by the subVI's Window Appearance settings. Open the VI Properties for the subVI, go to Window Appearance->Customize, and uncheck "Show vertical scroll bar" and "Show horizontal scroll bar".
  • "Offset": this is probably caused by the area between the controls and the inner border of the window. If you take a look at the "Subpanel Viewer" example it opens one of three subpanels. One of them is called "plugin1.vi", which is just a graph. The size of the window is slightly larger than the size of the graph, so this area shows up in the panel. If you were to resize the window so that it fits snugly around the graph, when the plugin is launched it will place the graph smack in the upper-left corner of the subpanel border.
  • Using a subVI that has controls. In all cases with a subpanel you have to run the VI before you insert it. Prior to running it you can set the values of controls using the VI Server. Connect an Invoke Node to the VI reference and select "Control Value->Set". Pick the variant or flattened version - the variant one is probably adequate for your needs. Note that you need to do this before you use the "Run" method to run the VI (which you must do before you insert it into the subpanel).
  • Having both subVI running: This is no different than normally having the two subVIs running. Having them inside a subpanel only affects how they're called, not how they run. When you use the "Run" method you will want to set the "Wait until done" input to False so the subVI is launched and control is returned to the main VI.
If you still can't get it to work post your code and somebody here can take a look at it.
0 Kudos
Message 4 of 4
(2,669 Views)