08-21-2013 01:10 PM
Hi, I have a ring control that I want to use both as an input and as an indicator. Depending on a mode of operation, the user either selects a value from the ring or this value is selected by the program itself.
I am trying to achive this by using the RingText.Text property node. While I am able to read from it just fine, when I am writing to it like this
the value is not updated: I expected to see "None" written in all the ring controls above but instead they retain their previous values.
Can I achieve this at all?
Thanks in advance,
Peter
Solved! Go to Solution.
08-21-2013 01:25 PM
I think you should probably be using the "Strings[]" or "Strings and Values[]" property instead?
08-21-2013 01:26 PM
Use the "Strings[]" or the "Strings and Values []" (if you need to change both the name and the numeric value) property with an array of your desired values.
08-21-2013 01:30 PM
Hi SenSLabs,
I think something like this would do the trick:
Regards,
08-21-2013 01:30 PM
FYI - if you right-click on the property node, you will see an option for help on that particular property. I use this a lot when I'm not sure what the property is. 🙂
08-21-2013 01:41 PM
Bill an Mark,
thanks for your suggestions!
They are not exactly what I need, because they change the possible ring entries, which I don't want. For example, if I start a run with a ring having possible strings as ("a","b","c"), then I want to select one of those on the fly (say, change to "b") but at the end of the run to still have the ring's possible strings as ("a","b","c"). Your solution would replace those with one value only ("b" in my example above).
I am going to try Tom L solution now.
Thanks a lot for taking the time to respond!
08-21-2013 02:01 PM - edited 08-21-2013 02:03 PM
Hi Senslab,
to select one of the ring's entries you simply write it's associated value to a local of the ring (or use the value property...)!
When you have the strings "a", "b" and "c" (with values 1,2, 3 respective) and want to select "b" you have to write 2 into the value property!
Lessons learned: always give a good example/description of your problem to receive more helpful answers!
08-21-2013 02:03 PM
Tom, this is great, thanks!
08-21-2013 02:04 PM
GerdW,
Thanks as well, it is indeed the case!
08-21-2013 02:11 PM
Glad to help!
One thing to note is that you'll probably want to add logic for strings that aren't found- the search array will return a "-1" for the array index and then the index will return a value of zero (the default value for the data type.) A case structure with cases for -1 and 0, default with logic appropriate to your application (error reporting, etc.) would be a good start.
Regards,