12-22-2008 10:02 AM
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.
12-22-2008 11:05 AM - edited 12-22-2008 11:07 AM
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
12-22-2008 03:42 PM
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...
01-04-2009 05:18 PM
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?
01-05-2009 02:43 PM
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.