LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Entry bug when a Numeric Control is controlled with mouse wheel

Solved!
Go to solution

My coworker discovered a feature while using a program I had written in Labview. If he place the curser on the data entry of a numeric control, he could increment the value by scrolling with the mouse wheel. However if the numeric control is set up with Data Entry limits, there seems to be a bug. 

 

When setting Data Entry limits to a numeric control to -10 and 10 in this example. Then incrementing the value using the mouse wheel, I would expect the value to stop at 10, but the value goes like this:

0, 1, 2, 3, ..., 9, 10, -10, 0, 1, 2, 3, ...

Same for decrementing:

0, -1, -2, -3, ..., -9, -10, 10, 0, -1, -2, -3, ...

kdVaage_1-1737106449934.png

This is in Labview 24.

 

0 Kudos
Message 1 of 8
(330 Views)

It does not do that in LV 2022 at least...It stops at -10 or 10 as you (I assume) expect (I have not got access to 2024 at the moment to see if it differs, but others hopefully can).

If it was just wrapping it could have been a nice feature in some cases making it quicker to get from 8 to -9 for example by just scrolling upwards...😀. Many devices work like that...but if it goes from 10 to -10 to 0 that is not the case🙁. Are you sure there is no code interfering with the value?

0 Kudos
Message 2 of 8
(300 Views)

Thanks, I just checked in LV 2016, there it also works as expected.

 

In LV 2024 I can replicate by placing a numeric control in a empty VI and configure the Data Entry limits, so there is no interference.

Same response if i place the control in a while loop and run the VI.

 

kdVaage_0-1737129343612.pngkdVaage_1-1737129509489.png

 

 

0 Kudos
Message 3 of 8
(285 Views)
Solution
Accepted by topic author kdVaage

Hmm, interesting, you're right, at least:

 

snippet.png

 

Wheel Up:

up.gif

 

and wheel down:

down.gif

Message 4 of 8
(282 Views)

Thank you for verifying, and the very nice demonstration 😎

 

I have reported the bug by following this knowledge article: Report an NI Software Bug.

 

0 Kudos
Message 5 of 8
(270 Views)

Tested it now in 2024, it works as expected there too:



This is with mouse wheeel support set on hover so that you can just hover over the control and scroll:

Mads_0-1737140088110.png

 

(As the demo shows it will still generate a value change event whenever you try to set the value even when the attempt is to set it outside its limits though, that also happens if it is set to ignore instead of coerce... 🤔)

 

0 Kudos
Message 6 of 8
(253 Views)

That is strange...I recreated the code you had with mouse wheel events, a double etc. and it reports the expected behaviour, not the rollover you get.

This is in 2024Q3. Perhaps you could post the malfunctioning code example, to make sure everything is exactly the same.

0 Kudos
Message 7 of 8
(248 Views)

kdVaage_0-1737385664163.png

I think the weird jump is due to the cursor jumps in front of the number around 0 and 10. So as soon as the value reaches 10 it starts incrementing by 10 at a time, thus jumping from -10 to 0 in one event. As soon as there only is one digit, it increments by 1 at a time again. 

 

In the image above I made sure to always keep the cursor at the back of the number, thus only incrementing by one.

 

Still, ideally it should stop at the limit, not wrap around. 

I am also on LV2024Q3, windows 10. See attached vi..

 

0 Kudos
Message 8 of 8
(120 Views)