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.
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.
05-16-2019 08:29 AM
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?
Solved! Go to Solution.
05-16-2019 08:53 AM
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?
05-16-2019 08:59 AM
The problem I am running into is the Strings[] property doesn't appear to be an option for an array of rings.
05-16-2019 09:14 AM
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.
05-16-2019 09:32 AM
Here is an implementation per the suggestion from MaxJoseph:
05-16-2019 09:37 AM
You can right-click on an array element and create a property node for the elements.
05-16-2019 09:58 AM
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.
07-14-2021 08:15 PM
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
07-14-2021 08:47 PM - edited 07-14-2021 08:49 PM
paul_cardinale's example inspire me. Here is my solution. Maybe is not a perfect way.
07-15-2021 01:41 AM - edited 07-15-2021 01:43 AM