09-08-2010 01:04 AM
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
09-08-2010 04:16 AM - edited 09-08-2010 04:16 AM
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
09-08-2010 06:37 AM
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?
09-08-2010 08:34 PM
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