LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Current Index of System Ring

Solved!
Go to solution

I need to know the index of the ring box that is currently displayed on the Front Panel during runtime.

The values of the ring box don't necessarily correspond to their indices so I can't just wire the ring box itself to the DisabledItems[] property.

 
The way I am having to get the index of the "currently displayed" item of the ring control is by doing the following:

 Getting Ring Box Index.JPG

 

A read to the Strings[] Property returns an array of Strings of the "Items" of the ring control.

A read to the RingtText.Text returns the string value of the current Item displayed in the ring control.

 

I use the search function to search the Strings array for the current text and it gives me the index of the current item displayed in the ring control. 

 

Is there a way to get the index of the currently shown index of the ring control directly?

 

0 Kudos
Message 1 of 8
(25,607 Views)
Solution
Accepted by topic author goodnaysayer

In one word NO.

 

the method you are using is the easiest.  If the srtings are very long you could unbudle Values[] from strings and values property and search that array just to save some (really minor) memory.  Bear in mind, System controls properties are dependant on the OS


"Should be" isn't "Is" -Jay
Message 2 of 8
(25,598 Views)

I am confused about this thread so it must mean thre is something here that I am missing.

 

Good!

 

Why not just use the value from the terminal?

 

Standing by to learn something,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 8
(25,588 Views)

Thanks for the quick response.

This implementation seems to work fine, I'm just nitpicking at bits of code right now trying to debug a bigger issue. 

Life is pain.

I'll keep in mind the Values[] tip if I notice any lag time at any point.


0 Kudos
Message 4 of 8
(25,586 Views)

Ah, I think I see the issue. The problem is that you can assign non-sequential values to a ring control so index 0 might have a value of 128 but index 1 could have a value of 42 (which in case you forgot is the meaning of life, the universe and everything...). Therefore, the index isn't necessarily the same as the terminal value - though the way most people use them, it often is.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 8
(25,584 Views)

Ben - "Why not just use the value from the terminal?"

Because I am not using sequential values in the ring control. 
If the value of the object in the first index is 0 and the value of the object in the second index is 9000,

using the value from the terminal will work for the first value but not the second. 

Message 6 of 8
(25,583 Views)

My apologies, everyone. It seems like I'm a little off today on my reply timing, haha

0 Kudos
Message 7 of 8
(25,580 Views)

@mikeporter wrote:

Ah, I think I see the issue. The problem is that you can assign non-sequential values to a ring control so index 0 might have a value of 128 but index 1 could have a value of 42 (which in case you forgot is the meaning of life, the universe and everything...). Therefore, the index isn't necessarily the same as the terminal value - though the way most people use them, it often is.

 

Mike...


My favorite use for a ring uses values like 0xFF0000, 0x0000FF, ect....  (Now if the silly items editor was updated I could just drop color constants into value) Smiley SurprisedSmiley HappySmiley HappySmiley Happy

Status changed 3 days ago !! WoooHooo!


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(25,560 Views)