07-15-2012 04:28 AM - edited 07-15-2012 04:30 AM
Hello,
I am trying to scroll an array using mouse wheel. It works, but not smoothly. I've tried also not to use the "direct" values from "scrolling" and tried to use "Quotient and Reminder" operation, but it is still not running smoothly.
If you spin up and down your mouse wheel you will see that the array scrolls up and down, but sometimes it stops for a while and start again. I tried to change the wait time (5, 10, 20, 30, 50 ms) without success. I've also tried to put the code in a Timeout case of an Event Structure.
I know this question had been asked a hundred times before but I am trying to find a very simple way to use the function.
Find attached my code.
Thanks.
Dan07.
07-15-2012 06:03 AM
Strange, for me it works smoothly (Core i5)
Anyway, try to do this without polling: http://forums.ni.com/t5/LabVIEW/Mouse-wheel-scroll-event-ON-CHANGE/m-p/1137666#M501292
Andrey.
07-15-2012 06:19 AM
Hello,
I know this thread that you cited. It was the same that I put the link in the original message. I have already posted on that thread and the code from Mike works very well. But I was trying to do something smaller and simpler. I have a Core 2 Duo 1.6 and it is not working smoothly.
Thanks.
Dan07.
07-15-2012 06:32 AM
Ah, I see - you already know how to do this without polling.
Well, with polling you have not so much chances for really smooth scrolling. Depends from CPU load you may lost some events.
What you can do - open mouseAcquire.vi. Inside you will see DLL call in UI thread. Try to switch it to thread safe (you can make your own copy of this VI). Should be better.
Another point - IndexVals Property nodes also executes in UI thread. Try to split polling loop and loop with property nodes int two parallel loops.
Andrey.
07-15-2012 06:57 AM - edited 07-15-2012 06:59 AM
Hello,
I tried what you said but it is not running smoothly yet. Find attached another version of the VI.
It is just a draft. Because of that the code has two stop buttons, a lot of error wires, etc.
Thanks.
Dan07.
07-18-2012 03:13 AM
Anyone else have a suggestion on how to resolve this?
07-18-2012 12:27 PM
I can only confirm that with LabVIEW 2011 scrolling is not smooth 10-20 seconds after LabVIEW launch.
I added simple timing check:
And what I see:
Looks like some background activity after launch (palettes preload, or may be QuickDrop list, etc). But when cycle time stays with 10 ms, then scrolling OK.