LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for suggestions on using Sub Panel Templates

I am trying to use a sub panel scheme to allow the VIs loaded via a menu ring that will be populated once a "Plug In" directory has been scanned

and the VI file names parsed and sent to the menu ring,  this will occur each time the application is launched.

 

While making my sub VIs is there a way to setup the front panel and lock it in position so I do not move during the developemnt phase?  That way

all the VIs that are ran through the sub panel will all be cenetered and framed the same way.

 

Best Regards

Tim C.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 7
(2,989 Views)

You can of course create a template that you can use to create subpanel insert VIs of a standard size. Alternately, you can create a subvi that automatically resizes and repositions the subpanel such that it is always centered regardless of it's size.

 

Mike... 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 2 of 7
(2,977 Views)
I think you mean the origin of the VI. This is a bit of a hassle.

When you have scrolled a sub VI that's inserted in a subpanel, it looks bad.
So, create a property node and connect it to the VI's pane. Set it to 0,0,
and all scrolling will be undone. This will work in LV8.5.

In LV 7 till I think 8.2.1, this resulted in an error. You could not set a
VI's origin when the VI is in a subpanel. You had to set the origin, then
put it in a subpanel, then run it...

Regards,

Wiebe.



Message 3 of 7
(2,959 Views)
> In LV 7 till I think 8.2.1, this resulted in an error. You could not set a
> VI's origin when the VI is in a subpanel. You had to set the origin, then
> put it in a subpanel, then run it...

It works in 8.2.1 too, so in 7.1 and 8.0 it's a hassle, in >8.2 it's easy.

Regards,

Wiebe.


Message 4 of 7
(2,959 Views)

I put the code for resizing/scrolling the FP into a case that is not executed (constant=false). When I made changes in the VI, I switched that constant temporary to true and execute the VI (not loaded into the Subpanel). Better than nothing...

 

Felix

Message 5 of 7
(2,954 Views)

"F. Schubert" <x@no.email> wrote in message
news:1219754405744-767315@exchange.ni.com...
> I put the code for resizing/scrolling the FP into a case that is not
executed (constant=false). When I made changes in the VI, I switched that
constant temporary to true and execute the VI (not loaded into the
Subpanel). Better than nothing...&nbsp;Felix

But why? If your main vi puts the sub vi in a subpanel, and then starts it,
you might as well set it's origin and then start it. This way, you can debug
and test your vi without setting the origin, and in the real version, the
origin will be set.

Another schema I use is to start a VI dynamically, and pass a sub panel
reference to it (set a control value). Then I run the VI. The VI can then
remove the current vi from the sub panel, set it's origin (or not, let the
VI deside), and put itself in the sub panel. The main reason I do this, is
that sometimes my VI's in the subpanels need to resize itself when the main
panel resizes. So when the main panel resizes, I send a user event. All
dynamic VI's will receive this user event, and can resize themself. They
have the reference of the sub panel they are in, so the sub vi's can get the
dimensions of there sub panel, and resize properly.

Regards,

Wiebe.


Message 6 of 7
(2,943 Views)
Having done something like this, I fully agree with what Wiebe is saying.  Use your infrastructure to set the (0,0) point and put resizing code (if any) in the plug-in itself.  I would add one further optimization.  Do not put all the top-level VIs in a single directory.  Instead, put information files into the directory, one per top-level VI (or group of top-level VIs).  The information file will have the path information, but can also store a lot of other things, such as a nice, localized user name for the VI instead of the raw VI file name.  This also allows you to build a file hierarchy for each plug-in without cluttering a single directory.  You can use configuration files, XML, (insert file format of choice), or another VI for the information files.  I usually use the latter, since it allows me to do dynamic optimizations.
Message 7 of 7
(2,922 Views)