11-03-2008 07:16 AM
Solved! Go to Solution.
11-03-2008 07:26 AM
Hi,
When you click on slider and you start dragging it, for every increment on the changed value, LV generates an event.
So to fix it you can use the event mouse up for exemple. It will generate an event when you release the mouse. But il will not work with the digital display....
Hope it will help,
Marc
11-04-2008 07:40 AM
Sliders and cursors are famous for generating large numbers of events. You can reduce this to a reasonable number in a couple of ways.
11-04-2008 08:08 AM
Hi there
2b: Set the timeout of your event structure to a value suitable for you (e.g. 100ms). Inside the TimOut - Event pass the current control value to a shift register and compare the current value with the last one written to the shift register. If they differ write to the HW, if they are the same do nothing. Remember not to define the Value changed event of the control in your event structure.
11-04-2008 11:08 AM
LabVIEW 7.2 does not really exists.
Identcor wrote:
I verified that when I click (one time) on the slide to change the value, the event occurs more than one time so, the value is send to the motor more than one time.
I don't think this analysis is correct. Every time the event triggers, the value will be slightly different.
You potentially have several problems to address:
All this can be done with code to filter out unneeded events. First, you need to make sure the event is set to NOT lock the front panel until it completes. This ensures that the user can always operate the control, even if the event is still executing. Nothing is more frustrating to the user than an interactive control that becomes unresponsive for short intervals. To see if an event is stale, easiest would be to compare the actual terminal with the "new value" event terminal. Just spin an empty case if this happens, draning the stale event. See also this old demo that shows some of the ideas.
A typical user will not "click" on the slide, but will drag the slider to the new locations, possibly interactively watching some other indicator for feedback. Same as you would ajdust the sound volume for example. You keep sliding up/down until you're satisfied with the volume and the only interesting value is the last setting. It would be very unintuitive if the volume would only change after you release the control.
11-05-2008 06:31 AM
Thanks very much everyone. I am trying to implement the ideas you gave me.
And Altenbach : You're rigth I'm using LabView 7.2 and, the values are equal due to the slider property: data range, out of range Increment, Coerce to nearest.
Thanks again for your help.
11-05-2008 06:33 AM