LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Fit-To-Pane for VI in SubPanel

Hi everyone,

 

i can not figure out how to fit-to-pane the vi inside a subpanel.

what i want, is that the subvi uses all the space available in the subpanel.

but neither invoke nodes nor property nodes seem to have what i am looking for.

 

attached is my test vi and a test tdms

(the path to the subvi may vary. i use the "TDMS - File Viewer.vi" from the utility library)

 

i would love your suggestions.

 

regards

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Download All
0 Kudos
Message 1 of 8
(5,338 Views)

I use a combination of "manual fitting" and "autosizing" (mainly because I'm too lazy to try to do all the programming in one fell swoop).  Here are my steps:

  1. On my sub-VI that's to appear in a sub-Panel, I put a Decoration (I typically use a Raised Frame) around the elements I want to see.  This is a convenient way to "exclude" the Error Indicators, for example.
  2. I arrange my Front Panel Objects "nicely" within this Frame, resizing as necessary.  When I'm done, I select the Frame and its Contents and from the Reorder button on the Menu Bar (that's the fourth in the series that starts with Align Objects and Distribute Objects) and choose "Group".  This "locks" the items into the Frame so you don't accidentally disrupt your handiwork.
  3. I size my sub-Panel (manually) to exactly fit my Frame.  Note that sometimes I do this in reverse -- I size the Frame to fit my sub-Panel, then do step 2.
  4. Now for the Magic.  Install the OpenG Toolkit from the LabVIEW Tools site (use VIPM).  There's a function called Fit VI Windows to Largest Decoration in the Applications menu.  Put this first in your sub-VI, and when it starts to run, it will resize to the Frame, which will now fit your sub-Panel.
  5. Take a bow.

Bob Schor

Message 2 of 8
(5,323 Views)

thx bob, for a vi that is "under my control", i will remember your way.

 

but in this specific case i want to use the "TDMS Viewer.vi" without the need to modify it.

still hoping there is another way.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 8
(5,315 Views)

What I usually do is create a plugin subVI template with the front panel window sized to the subpanel dimensions. When loaded into the subpanel it then fits perfectly.

 

Ben64

Message 4 of 8
(5,288 Views)

thx ben, also not what i was hoping for .. but i see that i have to think about a different approach than i initially thought of.

 

regards


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 8
(5,264 Views)

Well you -might- be able to populate a list of controls on the FP of the sub-VI you are talking about and work out how to scale them programmatically.  This is of course assuming that there is no code in the sub-VI doing the opposite......which you can't switch off since you don't own the code.

 

This sounds like a LOT of work for something which will be so specific that it'll only work for that ONE sub-VI and might break on a LV update because the control positions change........

0 Kudos
Message 6 of 8
(5,262 Views)

thx for the suggestion, but as you yourself said .. very much not robust 😉


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 8
(5,258 Views)

hi, i struggled with the same issue and found the following as a solution for me:

EliasL_0-1627483006023.png

 

Message 8 of 8
(3,012 Views)