LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with position of typedef controls

I have a large VI which uses typedef enumerated controls. During execution I am programmatically changing the position of the controls. When I convert the VI to an executable runtime the positioning of the controls doesn't work correctly...the controls don't end up in the same place as during debug. I have verified that the same coordinates are being fed to the property nodes in both debug and runtime. I did find that if I disconnected the control from the typedef the control started behaving itself when being positioned. Any ideas? Thanks...
0 Kudos
Message 1 of 8
(3,470 Views)
Can you post a simplified version of your code? I'd like to take a look at this.
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,446 Views)
I have attached an .LLB with a simple VI and custom controls. The VI has two rings and two enums. One ring is linked to a typedef as is one of the enum (shown in the control label). All the vi does is write the position from one to another. If you disconnect the typedef from the control the position ends up the same. As a typedef the control's position gets slightly translated. If you can take a guess as to why this happens I would appreciate it. Thanks.
0 Kudos
Message 3 of 8
(3,434 Views)
An interesting symptom is that if you wire the control's "bounds" and "position" out to indicators, run the vi and then disconnect the control from its type def and rerun it you will get different numbers, even though the control hasn't moved. Then if you do a "replace" and select the original type def, the resulting control will have jogged alittle bit from where the control was before. Hmmmm. I had noticed the movement between type defs and their predecessors as I have used them a lot lately. Noticed that if I had carefully aligned my control with something on the FP, decided to make it a type def, when I when I applied changes the original control would move slightly.


Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 8
(3,423 Views)
This is a known issue. Here's what's happening. The position values for regular controls take the position of the label into account but the typedef objects do not. Let me illustrate. If you set the position of a typedef, it will ignore the label and put the left top pixel of the control itself at the specified coordinates. This can cause the actual control part of the typedef to line up with the label of a regular control, which is what you are seeing in the example you posted.

Hopefully knowing this will enable you to position and program things such that you achieve your desired behavior. R&D is looking into this issue for a possible change in later versions of LabVIEW. I apologize for an inconvenience this causes.
Robert Mortensen
Software Engineer
National Instruments
Message 5 of 8
(3,404 Views)
Thanks for your response. I agree with you that the controls are exhibiting the behaviour you described. What is curious is that when I converted my program into a runtime executable my typedefs behaved as if they were were normal controls (for positioning). Does creating a runtime exe do anything to typedef controls? Thanks.
0 Kudos
Message 6 of 8
(3,392 Views)
There is an option in the Application Builder on the "Application Settings" tab entitled "Disconnect type definitions and remove unused polymorphic VI instances". This option is selected by default and will actually turn your typedefs into regular controls. If you uncheck this option, your typedefs will still be connected to the control, and will exhibit the typedef behavior.
Robert Mortensen
Software Engineer
National Instruments
Message 7 of 8
(3,388 Views)
Thank you for your response. You have saved me many hours of head scratching wondering why my controls were misbehaving.
0 Kudos
Message 8 of 8
(3,379 Views)