LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to show VI frontpanels within another VI frontpanel

Following problem:

I want to display and operate the frontpanel of abc.vi within a defined area
of the frontpanel of xyz.vi, without having to show two seperate and
independent VI panels.

Two possible ways:

1. Is there something like a frontpanel container, which I can insert into
xyz.vi and redirect the abc.vi panel (with input and output) to this
container ?

2. Can I create and add frontpanel objects programmatically in xyz.vi,
controlled by abc.vi (maybe with VI server etc. etc.)

I would be glad to hear from you

Oliver Friedrich

TZ Mikroelektronik
0 Kudos
Message 1 of 5
(4,022 Views)
Nope, neither.

However, what you can do is make your sub-VI appear without title or scroll
bars and programmatically set the position of the sub-VI so that it appears
to be embedded in the correct region of the calling VI's panel. This
illusion will be quite convincing unless the user does something
inconsiderate like moving or rearranging the windows. The "embedded" sub-VI
window must be "modal" so it stays topmost, otherwise a click on the main VI
controls will cause the sub-VI to disappear. You can always periodically
check the window positions and correct the position of the sub-VI if the
caller has moved.

This is all theoretical; you may have problems keeping the top window
topmost. You can't have it open as a "dialog box" in the VI settings since
then you can't use the other VI while it's open. You can always keep making
the VI topmost by repeatedly calling the relevant function, but this will be
horrible- wasteful of CPU and will probably produce disconcerting flicker.

There is a package of Windows utilities- search NI for "lvwutil32.zip". This
has a function that does an OS call to make the window topmost, so the OS
keeps it there without you having to bodge it. Under 5.x I was never able to
get this to work although no error was generated- you may have more luck.

Alternatively, do you actually need to be able to scan a directory for many
arbitrary "plugins" and call a user defined one as you seem to imply? If
not, you can make a tab control in the area you want the VIs to appear and
copy all your front panels to different tabs. This assumes Labview6. You can
then select the required tab programmatically when that VI is called. If the
sub-VI is to work in parallel and you need display updates before it
returns, modify all the sub-VIs to check to see if they are being called
from the top level or not, and if not to get a reference to the top level
VI's panel and use VI Server to allow the sub-VIs to interact with the front
panel copy that is visible at the top level. If all your controls are
uniquely labelled you could even make a generic set of functions, the first
of which you run at the start of a sub-VI to check if it's top level and get
a reference to the top level caller if not, and the second to periodically
synchronise all the controls and indicators of the sub-VI with those of the
relevant part of the top level VI panel. This is a trivial task. To ensure
there is no duplication in control names, if you take this approach you'll
have to relabel all the controls and indicators of the subVIs to include the
VI name. So "directory" becomes "SubVI1.directory" for example. You can keep
the word "directory" on the front panel by hiding the label and showing the
caption- the invisible label names the control and is used internally, and
the visible caption is just for cosmetics and can read whatever you like.

Oliver Friedrich wrote in message
news:3a5eef5d@newsgroups.ni.com...
> Following problem:
>
> I want to display and operate the frontpanel of abc.vi within a defined
area
> of the frontpanel of xyz.vi, without having to show two seperate and
> independent VI panels.
>
> Two possible ways:
>
> 1. Is there something like a frontpanel container, which I can insert into
> xyz.vi and redirect the abc.vi panel (with input and output) to this
> container ?
>
> 2. Can I create and add frontpanel objects programmatically in xyz.vi,
> controlled by abc.vi (maybe with VI server etc. etc.)
>
> I would be glad to hear from you
>
> Oliver Friedrich
>
> TZ Mikroelektronik
>
>
0 Kudos
Message 2 of 5
(4,022 Views)
"Oliver Friedrich" wrote:
>Following problem:
>
>I want to display and operate the frontpanel
>of abc.vi within a defined area of the
>frontpanel of xyz.vi, without having to show
>two seperate and>independent VI panels.
>
>Two possible ways:
>
>1. Is there something like a frontpanel
>container, which I can insert into xyz.vi
>and redirect the abc.vi panel (with input
>and output) to this container ?
>
>2. Can I create and add frontpanel objects
>programmatically in xyz.vi, controlled by
>abc.vi (maybe with VI server etc. etc.)
>
>I would be glad to hear from you
>
>Oliver Friedrich
>
>TZ Mikroelektronik


Set xyz.vi to be the parent window of the
abc.vi. A child window is alway confined
within its parent window, and is a
lway on
top the parent window. See my site for
more info.

George Zou
http://gtoolbox.yeah.net
http://rtprint.yeah.net
http://gtoolbox.topcool.net
0 Kudos
Message 3 of 5
(4,022 Views)
Hmm. I'm highly curious, and have downloaded the "G Toolkit", however I'm
reluctant to install any downloaded collection of VIs that needs me to run a
"setup.exe" to look at them.

I was given to believe you simply can't have child windows in Labview, as
well as non-rectangular VI windows, and tooltips also are something I've not
seen in a Labview VI. Are you having to do some quite nasty hacking for this
functionality, and if so what effect is it likely to have on stability?

George Zou wrote in message
news:3a5f4fbf@newsgroups.ni.com...

> Set xyz.vi to be the parent window of the
> abc.vi. A child window is alway confined
> within its parent window, and is alway on
> top the parent window. See my site for
> more info.
>
> George
Zou
> http://gtoolbox.yeah.net
> http://rtprint.yeah.net
> http://gtoolbox.topcool.net
0 Kudos
Message 4 of 5
(4,022 Views)
"Craig Graham" wrote:
>Hmm. I'm highly curious, and have downloaded
>the "G Toolkit", however I'm>reluctant to
>install any downloaded collection of VIs
>that needs me to run a "setup.exe" to look
>at them.
>
>I was given to believe you simply can't have
>child windows in Labview, as well as
>non-rectangular VI windows, and tooltips
>also are something I've not seen in a
>Labview VI. Are you having to do some quite
>nasty hacking for this functionality, and if
>so what effect is it likely to have on
>stability?


LabVIEW dosen't support those features directly, but LabVIEW does give you
CLF &
CIN to call any Win32 API functions.
Child window, non-rectangular window, and
tooltips windows are common in other
lang
uages, such as VC & VB. With CLF & CIN,
and basic knowledge of window programming,
I made those features available for LabVIEW
windows. There is no hacking, LabVIEW
windows are, after all, windows. If you're
a window programmer, you can achieve those
features without knowing what's really behind
LabVIEW.
0 Kudos
Message 5 of 5
(4,022 Views)