LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining the last value of a slide control

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...

0 Kudos
Message 1 of 4
(3,546 Views)

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…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(3,543 Views)

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

0 Kudos
Message 3 of 4
(3,531 Views)

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.


___________________
Try to take over the world!
Message 4 of 4
(3,519 Views)