LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse wheel value update

Hello everyone

 

I am trying to get the value from "mouse scroll" changed by mouse wheel. The attached code is very simple and seems to be right wired, but it's not working properly. If you run the VI and scroll up and down  mouse wheel, you will see that sometimes the value is updated on the indicator, sometimes don't. If you keep using the mouse wheel always on the same direction (i.e. up), the value on the indicator starts to increase but not after every single roll of the mouse wheel. Seems like a lack of sync between the while loop execution and the mouse wheel usage.

 

Any ideas how to trigger the loop just after mouse wheel usage? I have to sync them.

 

Thanks

 

Dan07

 

 

0 Kudos
Message 1 of 4
(2,662 Views)

Hi dan07,

i can't open your vi at the moment, but maybe this link helps.

http://forums.ni.com/t5/LabVIEW/Mouse-wheel-scroll-event-ON-CHANGE/m-p/1137666#M501292

 

With this code you don't poll the mouse wheel, you get windows events on which you can react.

 

Mike

0 Kudos
Message 2 of 4
(2,650 Views)

Your vi works on my computer. I would make sure that you have the driver for the mouse working properly. Do you get any errors when you run your code?

Tim
GHSP
0 Kudos
Message 3 of 4
(2,636 Views)

Mike

 

I got your Vis and did some modifications to adjust them to my code and everything is working like a charm. But I would like to understand what's going wrong with my code (the one that I attached on the first message of this thread). I did a very very very simple code that was supposed to do the jog, but it is not working. As I roll the mouse wheel the value on the indicator does not update in sync with the mouse wheel (sometimes it updates, sometimes don't). If I have my code working I can put it inside an event structure on the timeout case and use:

 

Mouser Enter array - feed timeout with 10ms

Mouse Leave array - feed timeout with -1ms

 

Anyway, thanks for your code.

 

Please, help me to understand what's wrong with mine.

 

 

 

Aested, my VI works on my computer too, but the value on the indicator does not update in sync with all movements of mouse wheel.

 

Thanks

 

Dan07

0 Kudos
Message 4 of 4
(2,605 Views)