LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create a sub-vi that automatically displays a front panel object?

I am trying to make a more modular test program to simplify my development time and I have a great idea to help myslef out  but do not know if it is possible or how to do it.  My items under test use identical components but they are hooked up in different configurations.  I want to build a Subvi that has all of the information regarding that component (inputs, ouputs, graphical representation...).  When I place that sub-vi I would like it to display my graphical representation with indicator lights and such on the front panel of my main vi.

 

For an example, if i was building a machine and I placed a sub-vi titled proximity switch in my main vi, I would want a graphical representation with the ouput status indicator of my sub-vi to display on my main vi's front panel automatically.  I want to do this without having to copy and paste and do all of the wiring like I currently do.

 

 

 

0 Kudos
Message 1 of 5
(3,276 Views)

Take a look at subpanel controls - "Use the subpanel control to display the front panel of another VI on the front panel of the current VI."  The example finder will get you started.

 

Jim

Message Edited by jcarmody on 12-22-2008 11:06 AM
Message Edited by jcarmody on 12-22-2008 11:07 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 5
(3,254 Views)

It sounds like you want what used to be called "merge VIs". When you place a control on the front panel it automatically brings with it a bunch of support code prewired...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 5
(3,219 Views)

mikeporter wrote:

It sounds like you want what used to be called "merge VIs". When you place a control on the front panel it automatically brings with it a bunch of support code prewired...

 

Mike...


I did some thinking about this and did finally figure it out, however I have found the same problem that was brought up in another thread  (Jim Kring http://forums.ni.com/ni/board/message?board.id=170&thread.id=377193).  When I place my VI, the front panel objects all seem to fall in a default positions rather than in the positions that I placed them in the sub VI.  For example if I put a raised square decoration on my sub-vi front panel and then placed a square led in the center of the decoration, When i placed my subvi the led indicator would be above the decoration. I need to work this out still.  Any ideas?

0 Kudos
Message 4 of 5
(3,123 Views)

Ssilk,

 

If I understand you correctly, you just want to have the front panel of the subVI show up as part of the front panel of your high-level VI. If that's the case, then I would stick with subpanel controls like jmacordy suggests. See the link below.

 

http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/loading_panel_in_subpanel/

 

The "Simple Subpanel" example in the example finder also shows you how to create a field where your subVI's front panel should show up.

 

 

 

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 5 of 5
(3,077 Views)