LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[GUI] Cannot filter value change event

Solved!
Go to solution

Hi,

 

In my front panel there are some controls like in the following image:

 

[GUI] Cannot filter value change event.jpg 

 

I'm not able to do the following:

when I modify the "value" button by arrows (or by arrow keys), I want to modify its "increment property" according to "multiplier value".

if ( multiplier == 1.0 )

        value.increment = 1;

else value.increment = 0.1

 

If I use the "value change" event on Value button, I miss the first update, becuase the event is processed AFTER the GUI rendering of the button. I tried different event, mouse enter and mouse down? but without success.

Any suggest?

Thanks

0 Kudos
Message 1 of 14
(4,282 Views)

Could you post an example VI?

 

I guess the increment value passed to the property is one iteration older.

 

Or you must update the property of Value control when the Multiplier Control's value is changed and not when Value control's itself?

 

Or you can use a string control for multiplier, and enable "Update Value While typing" for shortcut menu

 

 

Message Edited by Vsh on 11-09-2009 03:45 AM
0 Kudos
Message 2 of 14
(4,278 Views)

You can use the "Mouse Enter" Event to detect when the user has or is going to select the control and at that point programatically set the increment or decrement value (Data Entry Limits:Increment).  then, when the value is actually changed, you need do no more.

 

Shane.

0 Kudos
Message 3 of 14
(4,276 Views)

I am not sure if such approach is possible at all.... so here a better solution:

You can programmatically change the increment/decrement value of controls. So you can configure an event on value change of the multiplier, read the value and set this as increment/decrement for your value-control.

You can find the increment/decrement-setting (its the same for both) in the property node in Data Entry Limits >> Increment.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 14
(4,271 Views)

What Norbert B said is the best way to do it (coupling the "multiplier" value change event to setting the increment value of the required control programatically).

 

Shane

0 Kudos
Message 5 of 14
(4,257 Views)

Even though its a better apraoch, there's one catch. If you try to click on value increment/decrement arrows right after changing the Multiplier (by entering numbers) without clicking nowhere, the incremental value will be the old set value for the first time. because the very next instance of mouse click would be on arrows, at the same time the multiplier event triggers, incrementing the Value control by previous increment preperty.

 

I hope i am clear in what i am trying to say.

 

So i would prefer to have a string control for multiplier, and enable "update value while tryping."and follow what Norbert B has suggested. This case, Multiplier value change event triggers for each key hit. 

Message Edited by Vsh on 11-09-2009 05:06 AM
0 Kudos
Message 6 of 14
(4,246 Views)

If you're doing thing serially (more than 100 microseconds apart) then there will be no problem.

 

There's something wrong with someone expecting to be able to change the values of two dependent controls simultaneousy without the possibility of problems.

 

I don't see the real problem with this approach to be honest.  If you go the way Norbert has mentioned, there is no "mouse enter" event neccessary.

 

Shane.

0 Kudos
Message 7 of 14
(4,236 Views)

Thanks for comments

 

I am attaching a VI for futher clarify the problem.

Made with LV8.5.1, you can see the is a kind of "bug".

See the comments inside the VI.

 

Front panel:

front panel 1.jpg

 

block diagram, one event case:

block diagram 1.jpg

0 Kudos
Message 8 of 14
(4,224 Views)

It seems you have misunderstood the suggection.

 

The code is OK but the event case should be for the control "Multiplier 1" and not for "Value 1".

 

When you change the multiplier, update the value for the increment.

 

Shane.

0 Kudos
Message 9 of 14
(4,220 Views)
Solution
Accepted by Slyfer

Hi Slyfer,

See the attachment 

 

I hope your first time arrow click is solved now?

Message Edited by Vsh on 11-09-2009 07:01 AM
Message 10 of 14
(4,216 Views)