LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI front panel opens in different window

Good day!

 

I have made a sub-vi and used in it another VI.

 

Now, in the sub-vi I have a indicator, I want to show that indicator in my front panel 

I don't have the indicator from the subvi on my own panel, I can only open another

front panel when I double click the subvi.

When I copy that indicator I just get the indicator without all the logic that's made in the subVI.

 

How can I make a connection to my front panel?

 

 

0 Kudos
Message 1 of 11
(4,315 Views)

-You want to pass the indicator value from SubVI to main VI? (Updating a Control or Indicator of a Top Level VI from a SubVI :http://digital.ni.com/public.nsf/allkb/0F4EA104660C0AF38625726F0069B27E)

-You want to display the SubVI front panel itself? (Use the subpanel control to display the front panel of another VI on the front panel of the current VI:https://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/loading_panel_in_subpanel/)

-Maybe create sample Main.VI and SubVI and post for more info on what you are trying to do.

Thanks
uday
0 Kudos
Message 2 of 11
(4,311 Views)

Thanks for your help.

 

I added my VI with constant control to a sub-vi. When you dubble click the subvi a new front panel opens with a meter. This meter should be in the original VI.

 

So it would be your option 2, isn't there an easy way to do this?

 

 

Download All
0 Kudos
Message 3 of 11
(4,295 Views)

Did you read through the articles in the links udka provided?  There are several ways to do what you want (although it isn't clear exactly how you want to implement this)

 

The links provided show examples of two different methods of getting values from a subvi to a caller's FP.  

 

The shipping example: multiple vi's in a sub-panel.vi has some great documentation that you might wish to read

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(4,286 Views)

This will definitly work, but I still think there should be an easier way to this.

It would make sense if there is an option somewhere that you can choose like 'show on frontpanel'

 

I placed the subvi in my VI, why do I need so many things to actually show it in my VI..

 

 

0 Kudos
Message 5 of 11
(4,278 Views)

I tried to do it that way.. But the wire from the subVI icon to the Sub panel doesn't connect (step 3).

 

0 Kudos
Message 6 of 11
(4,272 Views)

Oke, got it.

It's working. But it ain't pretty..

Can't believe this is the only solution. Hoping somebody has another idea..

0 Kudos
Message 7 of 11
(4,269 Views)

@MCdyna wrote:

Oke, got it.

It's working. But it ain't pretty..

Can't believe this is the only solution. Hoping somebody has another idea..


It is not the only way

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(4,258 Views)

I get the impression you don't have a lot of programming experience, not just with LabVIEW.

 

One of the powerful things you do for yourself with subVIs(methods, functions, subroutines, etc in text-based) is you create reusable code.  The less you couple something, the more you can use this elsewhere.

 

If you couple the subVI to the mainVI with something like a right-click "show on front panel," you break this.  Not only that, it really doesn't make sense.

 

In this case, you want logic handled by the subVI to appear on the front panel.  Put the control on the main VI's front panel.  Create a reference to the control.  Pass this reference to the subVI.  Perform your logic on this reference.  Now, it'll automatically update to the front panel.

 

You can also use the subpanels option others linked here that allow you to show the entire subVI within the main VI.

 

These are all more flexible and cleaner than the solution you pose.  They also follow good programming practices rather than what you suggest.  There's others.  But, I won't suggest them because I think you'd be better served taking some programming tutorials and understand what you're doing before you blindly make choices in your application.

Message 10 of 11
(4,234 Views)