ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RingText.text property node not providing correct string

Solved!
Go to solution

Hi all,

 

I'm having a strange issue with using a text ring.

 

Steps of execution:

1. Programmatically set the ring string and values using this property node:

JCHEN_0-1729721533604.pngJCHEN_0-1729721533604.png

2. Read RingText.Text property but gets back <0>

JCHEN_1-1729721580048.pngJCHEN_1-1729721580048.png

3. If I use another method by indexing the Strings[] property with current value, then the returned string is correct (matching the displayed text on the ring)

JCHEN_3-1729721700429.pngJCHEN_3-1729721700429.png

 

Here are some screenshots from my actual application:

method using RingText.Text property:

JCHEN_4-1729721754957.pngJCHEN_4-1729721754957.png

 

method using indexing String[] property:

JCHEN_5-1729721797597.pngJCHEN_5-1729721797597.png

 

Problem is that if I take out the UI component and do it in a blank VI, the ring text property works as expected.

 

Expected behaviour works if code is running on a simple VI:

JCHEN_6-1729721908650.pngJCHEN_6-1729721908650.png

 

Anyone came across this issue?

 

Thanks in advance 🙂

 

LV Version: LV2018 32-bit

 

 

 

0 Kudos
Message 1 of 8
(2,139 Views)

Instead of a long set of pictures, attach a simplified version of your VI.

 

(Everything you describe seems to work fine in LabVIEW 2024, but we cannot really tell all your details)

0 Kudos
Message 2 of 8
(2,125 Views)

That looks like a strict type def'd control (probably set to allow undefined strings)  I would expect the "<0>"


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

Add a query after step1 to see if the value gets set properly.

 

George Zou
0 Kudos
Message 4 of 8
(2,103 Views)

I'm guessing that you've got a race condition; but I can't tell because you didn't post your code.

0 Kudos
Message 5 of 8
(2,060 Views)

@JÞB wrote:

That looks like a strict type def'd control (probably set to allow undefined strings)  I would expect the "<0>"


I did not see a black corner on the terminal and since he is writing a value of zero right after defining the strings&values property, and the string&value of the first item is ["A", 0], there is no reason to expect a <0> here, even if undefined string are allowed.

 

And yes, we cannot efficiently troubleshoot from pictures.

0 Kudos
Message 6 of 8
(2,043 Views)
Solution
Accepted by J.CHEN

Hi all, thanks for your response.

 

I didn't post the code because getting the ringtext.text property works as expected in a simple VI but not in my application.

 

Which leads me to think about the race condition in my application that @paul_a_cardinale has mentioned.

 

I've found the issue to be the use of defer front panel update function in a separate loop causing UI to update at an independent rate. It's all working fine now.

 

Thanks again.

 

Message 7 of 8
(2,027 Views)

@J.CHEN wrote:

Hi all, thanks for your response.

 

I didn't post the code because getting the ringtext.text property works as expected in a simple VI but not in my application.

 

Which leads me to think about the race condition in my application that @paul_a_cardinale has mentioned.

 

I've found the issue to be the use of defer front panel update function in a separate loop causing UI to update at an independent rate. It's all working fine now.

 

Thanks again.

 


Technically not a race condition, but yes, if you disable front panel updates you won't have any text to read from the controls ...

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(1,939 Views)