LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is ring control access in loop not in order of elements?

I have created a non-sequential ring control; the items in the list are not in sequential order of their values; however, when I attempt to access the items in a loop (using the loop iteration value as an index) the items in the list are accessed based on their values, not their position in the list. Is there a way that the items can be accessed based on their positions in the list and not their values?
0 Kudos
Message 1 of 5
(2,656 Views)
Could you post an example of your control? I'm unclear on what you mean by a non-sequential ring control.

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 2 of 5
(2,652 Views)
I assume you use the Strings[] property.
Try using the StringsAndValues[] property instead.
You will have to seperate them into 2 1D arrays and then use the value to extract the proper string from the string array.

___________________
Try to take over the world!
Message 3 of 5
(2,646 Views)
Non-sequential means that the values assigned to the items in the list do not have to be in sequential order. For example, here are some of the items from my list and the values assigned:

NAV_STATUS 3
INS_STATUS 1
GPS1_STATUS 2
GPS2_STATUS 4

NAV_STATUS is the first item in my list, INS_STATUS the second item, and so on; when I sequence through the list in a loop using the loop iteration value as an index, the items are displayed based on their values, not based on their list position as shown below:

INS_STATUS
GPS1_STATUS
NAV_STATUS
GPS2_STATUS

I need the items to be accessed based on their list position, not their values.
0 Kudos
Message 4 of 5
(2,636 Views)
Oh. Now I understand. You write a numeric value to the ring itself.
Well, that's the point of a ring. Each string is assigned a value, and when you ask for that value, you get that string.
Like I said, you can get the strings, and their values, by using the StringAndValues property. To access it, you need to create a property node. Right click on the control or the terminal and select Create>>Property Node. Then, find the property (the last one).

___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(2,628 Views)