LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserted VI position is wrong

Solved!
Go to solution

Hello,

 

I have created 2 VIs, one to test "pause and continue" conditions and the other just to call the first one into a subpanel. Even though the position of the "pause and continue" VI is set to (0,0) when called into the subpanel it is always shifted. Can't seem to find a solution even after I have manually entered all position and locked them.

 

I am attaching 2 pictures and the VIs so that it can be understood better, the VIs are saved as LabVIEW2012 format. Thanks in advance.

 

Cheers,

Screenshot 2023-02-16 154937.png

Screenshot 2023-02-16 155009.png

  

Diural

Download All
0 Kudos
Message 1 of 11
(1,190 Views)

Hi Diural,

 


@Diural wrote:

Even though the position of the "pause and continue" VI is set to (0,0) when called into the subpanel it is always shifted. Can't seem to find a solution even after I have manually entered all position and locked them.


There are two steps needed:

  1. You should place the controls of the subVI near the pane origin at (0, 0).
  2. You should also move the pane so its origin is in the upper left corner of the frontpanel!

You only solved step 1, but missed step 2!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,180 Views)

This might help for step #2 too:

 

altenbach_0-1676563483063.png

 

0 Kudos
Message 3 of 11
(1,133 Views)

@altenbach wrote:

This might help for step #2 too:

I didn't know that was an option. I've seen so many VIs that dynamically set their panel to the origin I figured that was the only way to do it.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 11
(1,127 Views)

Well, I learned "another way to make Front Panels fit in a sub-Window".  When I was first introduced to LabVIEW, my mentor told me about "OpenG" that was available from a group called "LAVA" (which stands for LabVIEW Advanced Virtual Architects).  Inside this was a function called ".Fit VI Window to Largest Decoration".

 

So in the VI that I want to make "appear" in a sub-Panel, I put a Flat Frame decoration around the part I want to appear.  I put the OpenG function as the first one to be called in the VI.  I also make sure that theFi size of the Decoration matches the size of the subPanel (easiest way to do that iVI s to run the VI to make it size properly, then drag the Front Panel on top of the main VI with its sub-Panel and be sure the frames are the same size).

 

All done.  Now when my main VI loads my sub-VI into its sub-Panel, I know it will fit when I ask it to run.

 

Indicentally, the OpenG Toolkit, which contains the OpenG Application Control Palette (with the Fit Window to Decoration function) can be found on the LabVIEW Tools Network, courtesy of VIPM.

 

Bob Schor

0 Kudos
Message 5 of 11
(1,111 Views)

@Jacobson-ni wrote:

@altenbach wrote:

This might help for step #2 too:

I didn't know that was an option. I've seen so many VIs that dynamically set their panel to the origin I figured that was the only way to do it.


It was new in 2019 (We need to uncouple the "edit mode" FP size from the "run mode" FP size).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 11
(1,098 Views)

Thank you everyone for all your answers,

 

I can't seem to solve the problem nonetheless unfortunately and will need you help once again. I will try to give even more info and attach my files once again with minimal changed compared to the previous ones. I have 2 VIs, the first one is the main VI which calls the second VIs using "insert VI property node".

 

Answer to GerdW:

I have tried both steps you have mentioned; the main VI's subpanel is located at (0,0) and the subVI's tab control is located at (0,0) thus should come up at (0,0) when called, I have even tried shifting the subVI's tab control a little bit to avoid controls being on top of each other that might create this shifting automatically. Am I doing something wrong? I have tried many things (That i don't even remember half of it) but could not get the result I was looking for. Am I using the panes that you have mentioned wrong maybe?

 

Answer to AltenBach:

I have tried this after I have tried what GerdW have suggested and nothing has changed, thank you for the contribution but if you have another solution and anything that comes to your mind I will highly appreciate.

 

Answer to Bob_Schor:

Thank you for the detailed answer friend! The only downside is that I don't think that I should use an "addon" perse because I will am creating an application that might be tossed around as source code and I don't want to create chaos where many (non LabVIEW users) has to download something to be able to work with the app (If you work somewhere with many departments that specialises in different areas you would get what i am implying :D)

 

I am looking forward to any kind of answer, Cheers,

Diural

Download All
0 Kudos
Message 7 of 11
(1,070 Views)
Solution
Accepted by topic author Diural

Hi Diural,

 


@Diural wrote:

Answer to GerdW:

I have tried both steps you have mentioned; the main VI's subpanel is located at (0,0) and the subVI's tab control is located at (0,0) thus should come up at (0,0) when called, I have even tried shifting the subVI's tab control a little bit to avoid controls being on top of each other that might create this shifting automatically. Am I doing something wrong? I have tried many things (That i don't even remember half of it) but could not get the result I was looking for. Am I using the panes that you have mentioned wrong maybe?


When I open your subVI from first message then the tab itself is located at the pane origin. But the pane origin is NOT in the upper left corner of the frontpanel:

GerdW_0-1676625632035.png

Move the pane origin to the upper left corner of the frontpanel!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(1,061 Views)

Thank you!

 

This forum has shown me that I need to look even deeper to find a solution, and even though I did it for this problem once again the solution was actually an easy one. Waow, thank you very much! Take care!

 

Cheers,

Diural

0 Kudos
Message 9 of 11
(1,051 Views)

@crossrulz wrote:

@Jacobson-ni wrote:

@altenbach wrote:

This might help for step #2 too:

I didn't know that was an option. I've seen so many VIs that dynamically set their panel to the origin I figured that was the only way to do it.


It was new in 2019 (We need to uncouple the "edit mode" FP size from the "run mode" FP size).


Totally missed this feature too 😮

I wonder if I should go back and update my dialog type vi's 🤔

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 10 of 11
(1,027 Views)