07-12-2016 03:39 AM
Hi All,
I am using a slide control to obtain a value that should be sent to the device. I am using a Value Change event to capture the values. But the problem is when I drag the slider, all the intermidiate values are also captured which results in too much traffic at the device end. Can anyone suggest a way to obtain only the last selected value in the slider?
I also tried using the combination of value change and mouse up event, but there are high chances that the mouse cursor moves out of the application window, which results in labview not capturing the mouse-up event and the value not updated to the device.
Any suggestions are welcome. Thanks in advance...
07-12-2016 03:41 AM - edited 07-12-2016 03:42 AM
Hi Prasaanth,
several options:
- with LV2015 you can watch the event queue and use filters on it. This way you could reject "too many" value change events…
- you could write the slider value into a notifier, which is pretty fast. Use a2nd loop to send the current notifier value to your device using a lower sample rate. (This way the notifier acts as buffer…)
07-12-2016 04:47 AM
Hi,
Maybe you should consider placing a 'Send Value' button. The value of the slider is read in the value change event of the button, so you won't generate so much traffic.
Regards,
Adam
07-12-2016 06:00 AM
With slides specifically, the simplest way is generally to compare the event's NewVal terminal to the slide's terminal and only do your code if this matches. This works because the terminal always outputs the current value, so this will only match on the last event.