06-23-2019 01:33 AM
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:
And here is the result:
I found two unsatisfactory workarounds
a/ Making a huge block diagram window, very unpractical.
b/ Moving the BD origin before placing the indicator:
but here again, LV seems to take some liberties with positioning because resulting indicators are not evenly spaced:
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?
Solved! Go to Solution.
06-23-2019 10:36 AM - edited 06-23-2019 10:37 AM
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.
06-23-2019 11:16 AM
Moving the terminal does work. Thank you very much.