From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenG Fit VI to Largest Decoration, How does this work?

I know what it does. You place down a rectangle or whatever shape as the decoration and the front panel is supposed to resize to the same perimeter dimensions as the "decoration". Now I want to put this in my VI's block diagram, so that when I run it, it resizes the very front panel of the VI I placed it into. 

 

I finally got OpenG on my Labview, but now that I have the Fit VI function on the block diagram, I'm at odds as to how to implement it. On the left side of the function is a terminal for VI Ref, which I create a Control out of. I thought I was going to be able to search for the file path, like with other functions, but that's not the case. Also, that would make this a recursive function, right? Which I don't think it is. 

 

And so I created a constant at VI Ref, but that created some generic Sub VI looking thing. Just wondering how to go about this? I would upload an example, but there's nothing much to it, just the function itself. 

 

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

If you just want it to resize the VI that is calling it, you don't need to wire anything into the VI Ref terminal. A common convention in LabVIEW is when you have optional inputs their default value is put in parenthesis at the end. So here, since it says "VI Ref (calling VI)" you can know that if you don't wire anything it, it will get a reference to the Calling VI by default.

 

Really, you don't need to do anything! Just put the OpenG VI down on your diagram, run it, and watch it work!

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

If you want to know how any OpenG vi works, you can open them and take a look.

They aren't protected and they are fairly well documented with comments.

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 4
(2,927 Views)

Hmm.  I thought my response to your original question was clear enough that you would just try it and have it work.  Oh, well.  Here's the FP before I ran this little routine, the routine itself, and the FP after.  I'm going to try to put the pictures here (which doesn't always work), but in any case, I'll attach them so you can look at them.  Note that the Block Diagram is actually a LabVIEW Snippet, so if you have LabVIEW 2016 (or 2017) and the OpenG Toolkit, you can drag this Snippet into a blank Block Diagram and run the code for yourself.

Front Panel, BeforeFront Panel, BeforeOpenG Decoration After.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note that after running the code, the FP has "snapped" to the Decoration -- you don't see the Error Indicators.  I'm attaching the Block Diagram, otherwise "the good parts" won't show up as a picture here.  Note that even if you don't have LabVIEW 2016, you can still open this as a PNG and create this simple VI yourself.

 

Bob Schor

 

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