Jump to content

Error 1 from "Fit VI to Largest Decorations" (OpenG)

Recommended Posts

My colleagues and I use the Fit VI to Largest Decoration function in OpenG all the time, and it (usually) works like a charm.


I've got a fairly small Project, a simple State Machine that takes readings from a Vernier SensorDAQ device and plots it on a graph.  I'm using a Queued State Machine pattern, so I begin by creating the State Machine Queue and enqueuing the Initialize State.  The first thing I do inside Initialize is Fit VI to Largest Decoration, and it throws Error 1, pointing to the final FP.PanelBounds Property node that it is setting to resize the Window.  I also watched this function run with Highlight Execution turned on, and sure enough, the Error line was OK until it got to that final Write to the Property node.


My initial suspicion was the SensorDAQ function, even though it hadn't been called.  So I took it out, but the error persisted.  I also tried making the Fit VI to Largest Decoration the first VI to be run -- same error.


Ohh, an idea.  The VI in question was written by a colleague, who is not big on LabVIEW style.  This morning, I rewrote the entire program, keeping only the Front Panel which has, among other things, a Graph on it.  This problem is so weird that it almost has to be something "unconventional" -- I'm going to leave this post here, in case anyone has other insights, but I'm then going to replace the Front Panel and will report back, especially if it fixes the problem.


Bob Schor

Link to comment

Certainly posting the VI might help.  Short of that I've seen this issue when using this function a couple times, all of which were expected if I had stopped to think about it.  The first is maybe your front panel has a minimum size set, and the decoration is less than that minimum.  In this case you won't be allowed to make the window smaller, so it throws an error.


I've also seen it do odd things when there are splitters and multiple panes on a UI, where it will try to scale the window to the largest decoration, but that decoration is only on one pane.  I've also seen where there is a minimum pane size, and again the decoration is too small.


I'm sure there are other reasons this VI can throw an error.  Because of these types of issues I don't use this function too often any more.  I also heard someone mention this function does nothing, and returns no error on the new cRIOs running embedded linux, with a monitor plugged in, but I didn't get a chance to debug it.

  • Thanks 1
Link to comment

Thanks, Hooovahh.  Didn't think about size.  I also didn't say, but I'm running 32-bit LabVIEW 2012 on Windows 7 64-bit.  I started tearing down the code that failed, got it down to two error clusters and the Fit VI function, still failed.  So I went the other way, wired two error clusters to Fit VI and put a decoration on the FP, no error.  Time to check panel sizes ...


That was it!  I never set this (don't know what my colleague was thinking), so didn't even bother to look here ...


Bob (sadder but wiser) Schor

Link to comment

It is a handy feature to have.  Especially for UI's that you have lots of panes and scaling happening.  There are times that going too small just breaks things, so you make it as small as you can, then set the size to that to make sure the user doesn't make the UI unusable.  Like I said there is a property for each pane as well but this is harder to get at because you need to drop down property nodes to read, they aren't viewable in the VI Properties.  And then weird things can happen if you try going smaller where a pane can't get small but the window can so I almost never use this feature.

Link to comment
  • 6 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.