LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse motion causes jump in cpu usage

Hi,
I have a program that I wrote in LabWindows/CVI. Normally the CPU usage is satisfactory, but when I pass the mouse over the panel the CPU usage jumps to 100%. We have to run another application at the same time (both are time critical), so this is a concern. What is causing this jump in CPU usage? Processing mouse events? forced redraw? Does anyone know a way to fix this problem?

ps. I have several other optimization related questions and was wondering if anyone knew of a good resource on this site or another that goes over some common ways of using LabWindows Libraries most effeciently.
0 Kudos
Message 1 of 2
(2,963 Views)
CVI has a sleep policy that defines how quickly it processes messages. You are getting MOUSE_MOVE messages when the mouse is moving over the panel. If you want to process these messages at a slower rate, use the CVI function SetSleepPolicy to set the sleep policy to Sleep More, or at least Sleep Some.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,963 Views)