LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scrolling an Array with Mouse Wheel

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.

0 Kudos
Message 1 of 7
(4,127 Views)

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.

0 Kudos
Message 2 of 7
(4,117 Views)

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.

 

 

0 Kudos
Message 3 of 7
(4,114 Views)

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.

0 Kudos
Message 4 of 7
(4,112 Views)

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.

0 Kudos
Message 5 of 7
(4,108 Views)

Anyone else have a suggestion on how to resolve this?

0 Kudos
Message 6 of 7
(4,092 Views)

I can only confirm that with LabVIEW 2011 scrolling is not smooth 10-20 seconds after LabVIEW launch.

 

I added simple timing check:

 

scroll0.png

 

And what I see:

 

scroll1.png

 

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.

 

0 Kudos
Message 7 of 7
(4,079 Views)