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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

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

Guest
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.

  • Similar Content

    • By Jim Kring
      [Update: NI Bug 974336]
      There seems to be a bug in the coercion of data to variant when a cluster contains a single element that is a variant. (original post here).
      Note: This bug appears to be very old, going as far back as LV2012. This has been reported to NI in the LV2020 Beta forum. I don't have a Bug ID / CAR yet.
      Coerce to Variant Fail (LV2019).vi


       
      Note that adding another element to the outer cluster causes the problem to go away.


    • By ShaunR
      Maybe others have seen this but I only became aware of it recently so I apologise if there is already a CAR for it.
      The following demonstrates a difference in behaviour between LabVIEW 2017 and previous versions (back as far as 2009, maybe further).
      The VI registers an event when it starts (in the timeout case) and generates a user event when the Increment button is pressed.
      The expected behaviour is that the counter will increment by one every time the button is pressed. This is the case for LabVIEW versions prior to 2017. In 2017, the user event is never fired, nor is there an error emitted by the generate user event.
      To get the VI to operate as expected in 2017; change the event refnum tunnel to a shift register. This seems to indicate that the refnum prototype is stomping on the dynamically allocated reference whereas in previous LabVIEW versions it would not. Note also, that when using the shift register, the cases do not need to be "wired through" as would be expected with similar functionality in a normal case statement.
      evnt.vi
    • By A Scottish moose
      Hey everyone,
       
      I am working on a backup function for a test executive.  The backup uses the 'class to XML' vi to create an XML string and then save it to a file to be reloaded later. All of my test specific information lives in the class (or one of it's children).  I like this functionality because it makes backup and reload brainless.  It just works.... until now... I've got a test class for my current tester that's grown rather large.  Everything works fine, until the tester loads some waveform data into either of the waveform arrays.  Without data in this field the class reloads just fine, otherwise if fails and says the XML is corrupted.
       
      As you can see in my backup vi I have built in a work around that flattens the waveform arrays to strings, drops them back into the class private data, deletes the waveform arrays and then writes the class.  This works! Much to my surprise both waveform data and the rest of the class data are written to file and reloaded without error.  
       
      Does anyone have any knowledge or experience with this? 
       
      Cheers,
       
      Tim


    • By Stobber
      If I create a DVR in a dynamically launched VI, the DVR ref goes stale when it's passed back to the caller. Anybody know why? See the attached code (LV15) for an example.
      I don't want to use the ACBR node right now because I want to set some control values of the VI ref on a different diagram than the one that will run it. (I just want to pass the VI ref between calling diagrams, not all the values that'll be passed into it.)
      DVRtest.zip
    • By bbean
      After reading this LabVIEW Idea exchange request:
      http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Provide-a-better-way-to-implement-a-polymorphic-VI/idi-p/920487
       
      I was inspired to create VI macro(s) to attempt to address the problem mentioned in the request.  Attached is my first attempt and I'm looking for feedback since I know people here have strong opinions.   The benefit of this method is that a single vim (or 2 could replace a polymorphic VI with over 48 separate VIs....unless I'm missing something.  I know that VI macros are not officially supported by NI, but that hasn't stopped us from using unsupported features before.  Some people have probably already done something like this, but I couldn't find an example.
       
      To use the files, unzip them and copy them all to your \LabVIEW (version)\user.lib\macros\ directory.  
      Create the directory if it does not exist.  For example: C:\Program Files (x86)\National Instruments\LabVIEW 2014\user.lib\macros\   And as described in the wait-ms-with pass through post below, modify your LabVIEW.ini file to have the following     ExternalNodesEnabled=True and Optionally     XNodeWizardMode=True   http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Wait-ms-with-error-pass-through/idc-p/3178218#M31820
       
      Open the Example Changed.vi and review.
      Changed Example.zip
×
×
  • Create New...

Important Information

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