LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control reference from panel and pane reference

Solved!
Go to solution

Greetings All,

 

I wanted to get all the references of all controls present in the front panel, I was assuming the order of refernece will be same as the order in which they have been created, this was true if I use VI-> Front Panel -> Control Reference but when I use VI->Front Panel->Pane->Control Reference I see the order is reversed. 

 

I am interested to know why this is happening, can someone explain me the reason for this behaviour.

 

PS:Please find the VI(Created in LV2014) and image replicating the above mentioned behaviour attached for reference

 

Thanks in Advance,

Sree.

0 Kudos
Message 1 of 4
(3,730 Views)
Solution
Accepted by topic author SreeRanjani

The actual order of elements in that list is either the Z order or the tabbing order (some lists certainly use the Z order, but I think that some might use the tabbing order. I'm not sure). Because each control you place is placed in the front, you get the list in reverse. If you change the Z order of the controls (using Ctrl+K/J or the reorder menu in the toolbar), you will see that this changes too.

 

My understanding is that the reason for this is so that lists of this type can include decorations, which can't be sorted by tabbing order. If you want, you can write some code to sort the array by something like the Y value of its position property.

 

Edit - I didn't look at your images before. I see that your question is actually about the difference between the Pane and Panel behavior. My guess would be that because they weren't implemented at the same time (panes were only added in LV 8.0), the actual code is different and either someone decided the pane behavior is more correct or it was simply an oversight. I doubt it's intentionally reverse. Like I said, you can change the Z and tabbing order to see how the lists are affected.


___________________
Try to take over the world!
Message 2 of 4
(3,718 Views)

Thanks tst,

 

Your answer was helpful

 

I did few modifications as you mentioned and have listed the outcomes

1) Getting control references using panel reference gives the control references in "Tabbing order" if I change the tabbing order I am able to modify the order in which they are getting listed

2) Getting control references using pane reference gives the control references in "Z order" if I change the Z order I am able to modify the order in which they are getting listed

3) Decorations are always in the Z order irrespective of how I get the decoration references (This may be because decorations doesn't have tabbing order)

 

PS:  Please find the images attached, I have modified the tabbing as well as the z order

 

Regards,

Sree Ranjani

0 Kudos
Message 3 of 4
(3,697 Views)

Some changes "May" have been made to the Z or Tabbing order of FP objects order on control referances in the panel referance property arrays.

 

DISSCLAIMER!: No documented order is presented to the user so, the orders are version to version subject to change! I can imagine that some newer features of LabVIEW could benifit from changes to the older rules of thumbs (To Wit: "Swooping a bunch of terminals on a BD - R-Clicking and selecting "Create>>Reference" Should NOT respect Z order over Y Order.) That was fixed right? 

 

However, you can "tag" those objects (I have not crawled down that "rabbit-hole" myself- others might have!) and tagging those object might be of help to you


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(3,680 Views)