Element Are Not Aligned When Calling Two Identical Sub-VIs In Sub-Pannel

Updated May 28, 2020

Issue Details

I am calling a sub-VI's dynamically using the Run VI Method, and displaying it's front pannel in a sub-pannel, using the SubPanel Invoke Node.
 
 

You can drag and drop this snippet in LabVIEW to copy the code.

When calling two identical sub-VIs (sub1.vi and sub2.vi) the elements from each sub-VI are not aligned within the sub-pannel. In this case, Boolean1 in sub1.vi and Boolan2 in sub2.vi don't appear at the same position in the sub-pannel.





I have tried editing the sub-VI's properties in order for each sub-VI to have the same position. However,  if I moove the sub-VI's scrolling bar, the position of the front pannel is overwritten when called in a sub-pannel. 


To edit the front pannel position : 
1. Open the sub-VI
2. Navigate to Files > VI Properties
3. Select Window Run-TIme Position in the Category drop-down menu 
4. Select Custom in the Position drop-down Menu
5. Deselect Use Current Position
6. Choose origin using the Top and Left Position

Solution

Before inserting the sub-VI in the sub-pannel, you can programmatically set the sub-pane's origin using property Nodes as bellow. 
In this case, the position is 50 ; 50. 
  
You can drag and drop this snippet in LabVIEW to copy the code. 

Therefore, when each sub-VI is inserted in the sub-pannel, the elements from their front pannel now have the same position within the sub-pannel.



 

Additional Information

When setting the Origin of the Pane programmatically, you are setting the the position of the dot on the front pannel of the sub-VI to a fixed position. Therefore, you are ignoring the position of the origin determined by the scrolling bar.