From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get text from array of rings

Solved!
Go to solution

So getting text from a single ring menu is easy enough with the Strings[] property. I however cant figure out how to do the same with an array of rings?

 

I would like to get the text from each element - or be able to read the array of texts in one element (as they are all the same), and index through the array based on the integer value of the ring selected. I'm drawing up a blank on both. The Ring is heavily integrated into my VI (plus I like how it flows in my GUI) so I don't want to change it. 

 

A work around would be me hard coding the menu options in a string array, but then if I want to add options later, I will have to remember to update the array of strings, which seems less than ideal.

 

Any ideas?

0 Kudos
Message 1 of 11
(4,398 Views)

This is probably easier than you think. I can't post any code because I am not on my development machine.

 

The Array of Rings is a list of indexes. You can use this to index the Strings[] property to return the specific string on the given Ring. So, take the Array of Rings, put it into a for loop with an indexing tunnel and use it to index out the Strings[]. Concatenate or array the strings to get your array of Ring strings.

 

Does that make sense?

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 11
(4,376 Views)

The problem I am running into is the Strings[] property doesn't appear to be an option for an array of rings.

0 Kudos
Message 3 of 11
(4,369 Views)

Hi

you can use the property ArrayElement->Reference to get the element refnum and use it with another property node to get the element strings.

ʍolɟɐʇɐp ʞuıɥʇ
Message 4 of 11
(4,356 Views)
Solution
Accepted by topic author DP2018

Here is an implementation per the suggestion from MaxJoseph:

 

RingArrayParser.png

dK
Message 5 of 11
(4,343 Views)

You can right-click on an array element and create a property node for the elements.

 

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 11
(4,337 Views)

That works perfectly, Thanks!

 

 

I had previously tried passing a reference to a generic strings[] property and it didn't work, but I was not familiar with the "to more specific class" function.

 

 

Thanks to all for the help.

 

0 Kudos
Message 7 of 11
(4,324 Views)

Hi, 

 

I need the same function but the value in ring list is not 0,1,2......, it's like 35, 42, 5.....
So the solution is failed.

Does anyone know how to do it ?

 

Thank you.

SySaLV2010

0 Kudos
Message 8 of 11
(3,137 Views)

paul_cardinale's example inspire me. Here is my solution. Maybe is not a perfect way.

 

Image 1.png

0 Kudos
Message 9 of 11
(3,130 Views)

Hi SySal,

 

you only need to determine the ring items once:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(3,100 Views)