LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Front panel objects randomly resizing themselves

Anyone ever have trouble with front panel objects resizing themselves for no apparent reason?  I have a tab contol as the main container for my program and looked through the size of it over the past few versions of my program and found it was different basically every time!  I'm on about version 35 of this program and it fit the screen perfectly until the last few versions and now appears squashed and only takes up about 2/3 of the screen (but everything seems to have scaled with it to the sqaushed appearance).  Could the automatic sizing options in vi properties be physically changing front panel sizes? I was under the impression that they only operated at run time and couldn't actually modify your code.  Thanks in advance for any ideas!

0 Kudos
Message 1 of 4
(2,868 Views)

If the controls are set to scale with the pane, then they will be scaled at edit time as well. You can see this by simply resizing the window. One problem with the scaling algorithm is that it only works in whole pixels. This means that if the scaling results in a non-integer (which is likely), you will get a rounding error. Over time these errors accumulate.

 

I don't know if that's what's happening in your case, but it's an option.


___________________
Try to take over the world!
Message 2 of 4
(2,864 Views)

@acolbourn wrote:

Could the automatic sizing options in vi properties be physically changing front panel sizes? I was under the impression that they only operated at run time and couldn't actually modify your code.  Thanks in advance for any ideas!


The resizing does seem only to operate at runtime but the effects can last a whole lot longer! Under certain circumstances which I haven't managed to quite nail down the FP objects new sizes seem to get saved back to the VI. Even worse, if you resize a panel a few times the objects gradually resize and/or move around relative to each other. The only way to fix it is to stop the VI and resize/reposition everything manually. I've seen a couple of attempts at code to manage panel resizing better but it was specific to that particular VI.

 

The other Labview mystery I've given up trying to understand is why sometimes controls assume their default value when a VI is run but at other times start up with the values they had when the VI was last shut down. I now always initialise them to their default values on the block diagram at startup AND shutdown. 

Message 3 of 4
(2,857 Views)

Interesting, I wonder if putting a sequence structure around the main body of your program would help?  Then initialize the variables inside frame 1 and see if it was maybe just a weird race condition.  

 

Sounds like you've both dealt with some frustrating resolution problems, I guess its just one of the downsides to labview that we'll have to deal with.  I think you're right that the automatic resizing is being saved and then errors are slowly propogating from version to version.  For now my solution is to change the window appearance from maximized to centered.  This seems to get rid of the squashing effect but the user still has to drag the program to the center of the screen because it appears off the side for whatever reason.  

0 Kudos
Message 4 of 4
(2,849 Views)