From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a SubPanel Control as Reference and how to pass Variables in and out of a SubPanel Loaded Vi

Hey,

I have a simple task, but I’m Surprised on how tedious it seems to accomplish.

 

In a XControl i call some Vis that require User interaction.

I pass some Variables in and out and up to now I displayed the SubVis as Popup

 

In a next step I wanted to display these SubVIs in a SubPanel and came across some strange habits

 

  1. For me it seems I need to use Global Variables?! to pass Information in and out of a VI within a Sub Panel?!

 

  1. I can't use SubPanels as Reference?! (I wanted to pass a SubPanel reference to my Xcontrol and my Xcontrol should insert / remove the Vis to the SubPanel but I wanted the SubPanel not to be a Part of The Xcontrol, only using it by Reference)

 

I can’t believe any of these Points to be True so how is the Correct way to achieve this in clean Code?

0 Kudos
Message 1 of 4
(889 Views)

Neither of those points are true, but I don't know what you are doing wrong.

0 Kudos
Message 2 of 4
(883 Views)

so...

How do i get a Reference Wire to a SubPanel?

and How do I pass Variables in and out a VI thats loaded in a SubPanel. I only found VI Reference by Path to VI and then Global Variables

0 Kudos
Message 3 of 4
(863 Views)

@PaulPascher wrote:

so...

How do i get a Reference Wire to a SubPanel?


Right click on the SubPanel (on the Front Panel) and "Create>>Reference".  Place teh reference on teh block diagram.

 


and How do I pass Variables in and out a VI thats loaded in a SubPanel. I only found VI Reference by Path to VI and then Global Variables


SubPanels are a Front Panel thing.   Any Front Panel can be used; they have nothing to do with how the SubVI is called/used.   I would guess (from others who have similar confusion) that you are thinking you have to do something complicated, like using "Open VI reference" in some way.  Your issues are likely in that, rather than in the SubPanel, so you might explain what you are doing there.

0 Kudos
Message 4 of 4
(829 Views)