LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

value changed event problem (bug?)

Hi all,
this one has been spotted by a friend of mine, but I thought I'd
post it for info.

Try setting a control knob on the front panel of LV 6.1 and then a
stop button.
Also add two boolean LEDs, and two Double precission indicators.

On the diagram, start with a while loop, and inside this, put an event
case with three possible cases.

Wire a 200 to the timeout node on the event case.

In case 1. a timeout - set this up to write to the first boolean a
FALSE, and put a FALSE to the edge of the event case.

in case 2. mouse up on the stop button - pass a TRUE to the edge of
the event case (same place as was done in case 1).

in case 3. make this a value changed on the knob - wire the old value
to one double indicator, and new value
to the other double indicator.
Wire these two through an equals comparison to the second boolean led
indicator. Wire a FALSE to the edge of the event case (same point as
the other two). Wire a TRUE to the first boolean indicator (use a
local variable).

Wire the edge of the event structure boolean to the while loop
conditional and make it a stop if true.

Save and run.
Now with the dial, move it slowly from zero towards 10 "backwards",
i.e. if you go far enough anti-clockwise it will jump. Before it
jumps, you should notice the first boolean flashing with every move-
this indicates that the event is running. Notice also that the old
value and new value indicators are the same, and the second indicator
is ON so they are exactly the same.

What you're seeing is the fact that the event value changed is being
called based on the dial movement, and not on it's value.

My friend was using this to update some other parts of his panel, but
because the change hadn't actually occurred, it zero'
d all his
indicators.

Just a warning in case you see this sometime in the future.

S.
0 Kudos
Message 1 of 3
(2,349 Views)
Hi Sash,

Definitely Looks Like a Bug...

I am Attaching the VI with some Pointers...

1. If you use the Digital Display to Change the Value - It works Fine.

2. The Value Changed event is not a true Value Changed Event But Linked to Mouse Clicks (See VI)

3. There is an Area on the Knob where by Just clicking you can generate the "Value Changed Event"

4. I changed your dbl Precison to Unsigned Integer so as not to do Floating Point Comparison and also for better the readability of Nos .

Good Job!! Lets see what NI has to say. I think they should take a compilation of all these bugs and release a patch. I for one do not like to wait for the next version to see these fixed.

There can be many work arounds for this situation. One being to actually
poll the Value of the Knob and Compare against the Previous Value using Shift Registers. Do Not Use the "OldValue" and "New Value" events. If now you see a definive change to accept the event or discard the event. The Polling of Knob can be done only when "Value Changed EVNT" occurs as we Now know that it occurs on Mouse Click.

Good Luck!!

Mache
Good Luck!

Mache
0 Kudos
Message 2 of 3
(2,349 Views)
Sash,

Thank you for letting other customers know of this issue. NI is aware of the problem and is working to address this and other issues we have seen with the event structure.

Regards,

Marcus Monroe
LabVIEW Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,349 Views)