Slider value not correct if moving quickly

I am using a slider to set the subwoofer level on a Denon A/V receiver via the TCPClient library. The slider range is 38 to 62. The command is PSSWL. (I do convert that 38 to 62 range to a more ‘user-friendly’ -24 to 24 in my HR, but am not including that here for the sake of simplicity.).

Say the slider is set to 40. If I click to move it to 60, the command sent is PSSWL 60, and the Denon returns PSSWL 60. No problem.

Say the slider is set to 40. If I slowly drag the slider to 60, the commands sent are, for instance, PSSWL 42, PSSWL 46, PSSWL 50, PSSWL 54, PSSWL 60. The Denon returns PSSWL 60. No problem.

Say the slider is set to 40. If I quickly drag the slider to 60, the commands sent are, for instance, PSSWL 46, PSSWL 60. The Denon returns PSSWL 46. I would expect it to return PSSWL 60, but it is as if the timing is off and it does not see it.

The way I am counteracting this is to save PSSWL 60 (per my last example) to a variable, and when the Denon returns the PSSWL 46 value, compare it to that variable and resend the “PSSWL 60” command since they do not agree. This is a successful workaround, but wanted to raise this issue in case there is something I am doing wrong or if there is something we can do about adding a delay to the slider. (I tried originally using a setTimeout, but it says it cannot find that function).

Increase the ChangeInterval on the Plugin instance. The default is 250 ms. It sounds like that might be too quick for your receiver. Try slowing that down to say 1000 ms (or 1 second). That will help ensure commands there’s a longer delay between commands. In this scenario, it’ll just skip the values in between & only send the last few values.

image

That’s the ticket, thanks! 1000ms works well.

I also have a numeric label next to the slider, so I clear out device.Bass (what I use for the subwoofer level) so it is not delay the ‘wrong’ value, and it is repopulated after the 1000ms interval with the new value. I will later work on having the label update ‘real-time’ as the slider being moved, even though it is only the last value that is sent to the receiver.

You could bind your Label directly to the Slider Value property so you see the value right away. Assign a name to your Slider & then use an Element Binding instead of a Device Binding.

Easy enough - thanks for pointing that out!