LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview VI scripting: positionning indicators on the block diagram

Solved!
Go to solution

I have positioning problems on the block diagram when creating indicators through VI scripting.

Looks like LabVIEW is taking some liberties with positioning  on the Block Diagram. I can't place them outside the Block Diagram viewable area. I made a small example VI (attached) which is supposed do create 8 evenly spaced indicators: 


labview-vi-scription-block-diagram-positionning problem.png

And here is the result:
labview-vi-scription-block-diagram-positionning-problem-result.png

 

 

I found two unsatisfactory workarounds
a/ Making a huge block diagram window, very unpractical.
b/ Moving the BD origin before placing the indicator:


labview-vi-scription-block-diagram-positionning-problem-partial-solution.png

  but here again, LV seems to take some liberties with positioning because resulting indicators are not  evenly spaced:

 

labview-vi-scription-block-diagram-positionning-problem-workaround2.png

Fun facts:
- The "New VI" position parameter affects both Block Diagram and Front Panel.
- I have the problem with controls such as indicators, but I can place nodes, such as invoke nodes, wherever I want on the block diagram.

Long story short, I suspect some kind of misunderstanding about the Front Panel / Block Diagram coordinate system duality. I can change an indicator position on the FP through its position property. But I couldn't find any way to script something  like "I want to move stuff on the Block Diagram only".

 

What am I missing?  

 

0 Kudos
Message 1 of 3
(2,256 Views)
Solution
Accepted by topic author yoctopuce

Apparently, the New Object is placing the control at a specific position n the front panel.  It isn't putting it at a specific position on the block diagram.  So it must be using LabVIEW's default rules for where to place the terminal, just like when you manually create a control on the front panel, the terminal seems to wind up in places that sometimes make sense, and sometimes don't.

 

What you can do is get a reference to the terminal of that newly created object, and assign the position to that as well.

indicator-position-test_BD

 

0 Kudos
Message 2 of 3
(2,224 Views)

Moving the terminal does work.  Thank you very much.  Smiley Happy

0 Kudos
Message 3 of 3
(2,216 Views)