LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a good way to reuse front panels?

Solved!
Go to solution

I have a general labview development question:

 

Suppose I have a VI with a nicely designed front panel, for example a VI that takes a waveform input and then simulates an instrument such as an oscilloscope or spectrum analyzer (with a bunch of options on the front panel).  I'd like to use this front panel in a larger program which adds some features (for example, preprocessing like averaging or filtering the data, postprocessing, changing the data source, etc.).  The new features are conceptually distinct and really deserve their own VIs.  Is there a good way to do this?

 

I've found three options, none of which seem ideal:

1.  Use show front panel for the subvis.  This works but it is annoying to have separate front panels popup for each new feature.

2.  Copy and paste all the front panel controls and indicators of the subVIs into a main VI and wire them up by hand to the subVI.  This is a little tedious and also adds a bunch of controls and indicators to the main VI that might be used only by the subVI.  

3.  Use a subpanel.   This is almost what I want but passing data to and from the subVI seems painful.  My understanding is that you have to get references for each control or indicator you want to use (in some nontrivial way such as searching for a specific control name) and use the value property.

 

What I'd really like is to be able to use subVIs in their normal fashion on the block diagram of the main VI (i.e. use the connector pane), but have Labview display the subVI front panel in the same window as the main VI front panel.  Is there a way to do this?  

 

0 Kudos
Message 1 of 5
(2,759 Views)
One other thought:  What I want is also conceptually similar to something like the graph control.  It has a nice "front panel" with a lot of bells and whistles the user can click on but still has a simple interface.  There isn't some way to make a custom control like the graph control where you add your own processing, is there?
0 Kudos
Message 2 of 5
(2,743 Views)
Solution
Accepted by topic author Phamton
Yes.  Use an Xcontrol.  An Xcontrol facade always appears the same on each FP that contains an instance of it  And it can take actions in response to events..   Check out this KB article (always a good read)

"Should be" isn't "Is" -Jay
Message 3 of 5
(2,729 Views)
Thanks, this is exactly what I'm looking for.  Is there anything similar to this in Labview 7.1?  I'm working on an old project in 7.1 but maybe it's time to bite the bullet and upgrade...
0 Kudos
Message 4 of 5
(2,723 Views)

Phamton wrote:
Thanks, this is exactly what I'm looking for.  Is there anything similar to this in Labview 7.1?  I'm working on an old project in 7.1 but maybe it's time to bite the bullet and upgrade...

Bite the bullet!  Driver support for 7.1 is dissappearingand the new features keep making more and more sense.  In-placeness, parallel for loops, VI recursion, Diagram clean-up, projects!... 7.1 was fun (and I still use it) but its getting long in the tooth.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,720 Views)