LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need mouse disable only - moving & clicking mouse during runtime caused 'hanging the program'

Hi all...
I have a VI program that controls a DAQ card which acquires up to 250kHz. During acquisition, the CPU usage is at 100% and any mouse movement causes program hanging.
 
I'd like to disable the mouse. I have found about using Call Library Function Node to a WINAPI function BlockInput. But it blocks keyboard input as well, which is need in the program to halt the running when required.
 
Is there another way to go about it?
 
Thanks in advance!
 
Regards,
D Hing
0 Kudos
Message 1 of 3
(2,246 Views)
Can you unplug the mouse while the critical task is running?

Lynn
0 Kudos
Message 2 of 3
(2,230 Views)
I think you may be going about solving your problem the wrong way. Moving the mouse shouldn't kill your program.. I routinely write acquisition software that acquires and logs data at high sample rates. I'm guessing that moving the mouse causes an error to pop up indicating that the sample buffer has overflowed, and killing your acquisition. There are things that you can do to prevent that from occurring. Let me know if I'm going down the wrong track here, or if you are running your program on a very old computer.

Just guessing, but I suspect that it is not the acquisition that is sucking up your cpu cycles, but maybe displaying the data on the screen. If you can live without seeing the data come in, you may be able to cut the processor usage by 50% or more. If you do want to see the data, there is a good thread on Max/Min decimation in here somewhere that discusses things that you can do to improve the performance of drawing a graph. Also, the buffer size for you acquisition can be increased, which will give your program more time to catch up when it falls behind (when it's paying attention to the UI, for example). And if you aren't doing this already, I suggest a Producer-Consumer architecture for your vi. The acquisition occurs in the producer loop, and logging and display occur in the consumer loop.

Good luck!
Chris
0 Kudos
Message 3 of 3
(2,227 Views)