LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Indicator displays wrong value of Enum

Solved!
Go to solution

Hello together,

 

 

I've a LabView 2012 application, running since years in our production.

For the operator visible, a text indicator "Active State" shows the actual state, e.g. "Press Start Button" ...

From time to time I'm facing following problem: the content of the indicator is wrong. It shows the old state like "Label printed",

although the machine is in the next state "Press Start Button".  Attached a simplified piece of code.

 

Any idea?

 

 

 

Clipboard-1.jpg

0 Kudos
Message 1 of 9
(5,190 Views)

Whoa! That's a lot race conditions! 

1. Why do you write state into property node value? 

2. You can't be sure about synchronisation of your loops. For example: the second loop will execute first, the indicator States will change its value, and then the first loop will run, reads the ring text and then it will change value to one that was produced by local variable... But imagine, that the second loop executes in the meantime between property node will read text ring and writes the value into itself (which is pointless).

 

what was your purpose of writing value into property node?

0 Kudos
Message 2 of 9
(5,168 Views)

no - of course this is wrong. That was just a test to find out if it eliminates the problem.

 

 

 

Here is the code which is used  (in simplified form):

Clipboard-2.jpg

0 Kudos
Message 3 of 9
(5,164 Views)
Solution
Accepted by topic author maximint

I don't see anything obviously wrong in your second example code, but since this isn't your actual system, there might be a bug there which isn't visible in the example.

 

Other relevant points:

 

  1. I suppose it is possible that the Text property doesn't actually reflect the updated text. It's obviously supposed to, but I have seen some bugs in things like this.
  2. You could probably just display the enum on the FP.
  3. If you don't like that look, I would suggest using Format Into String to convert the enum to a string, rather than reading the Text property.

___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(5,159 Views)

Thanks for your answer so far.

 

The Enum is on the FP, only visible for administrator and when the problem occured I found that Enum display was correct however

the string indicator display was not correct. I too have the feeling that this is a bug.

 

I'll switch now to "Format Into String", thanks for the tip.

 

 

I'll try to give a positive feedback in some weeks.

 

Thanks.

 

Clipboard-1.jpg

0 Kudos
Message 5 of 9
(5,151 Views)

In your first screenshot, your property nodes are backwards.

 

Property nodes execute from top down.  So first your are reading the current text state, THEN you are setting a new value.  then waiting 100 msec.  Only on the next iteration to you read the new value which was set in the last iteration.

 

Swap the order of properties in that node so you set the value first, then read the text.

 

PS:  Please attach actual VI's when you post examples so we can have a chance to play with it and poke at it to figure out what is going on.

0 Kudos
Message 6 of 9
(5,119 Views)

As written above. The first screenshot was wrong. Sorry.

0 Kudos
Message 7 of 9
(5,103 Views)

Then attach an actual VI that demonstrates the problem if you'd like further help.

0 Kudos
Message 8 of 9
(5,095 Views)

The issue is solved in the first instance, as described above. I have to monitor this and will report in some weeks if the problem is really gone.

I cannot reproduce the failure, I have to wait for it.

 

So no further help needed - at the moment.

 

Many Thanks to all of you.

 

 

0 Kudos
Message 9 of 9
(5,087 Views)