LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update RingText.Text on the fly

Solved!
Go to solution

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

 

Untitled.png

 

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

0 Kudos
Message 1 of 11
(3,551 Views)

I think you should probably be using the "Strings[]" or "Strings and Values[]" property instead?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 11
(3,546 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 11
(3,545 Views)
Solution
Accepted by topic author SenSLabs

Hi SenSLabs,

 

I think something like this would do the trick:

 

Untitled.png

 

Regards,

Tom L.
Message 4 of 11
(3,542 Views)

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.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 11
(3,541 Views)

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!

0 Kudos
Message 6 of 11
(3,533 Views)

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!

Best regards,
GerdW


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

Tom, this is great, thanks!

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

GerdW,

Thanks as well, it is indeed the case!

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

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.

 

Untitled.png

Regards,

Tom L.
Message 10 of 11
(3,506 Views)