LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with mouse and serial port

our CVI application uses the serial port to communicate with a product we are designing. moving the mouse dirupts the serial function. however if we configure the short cut in windows XP compatipility mode to windows 98 the mouse does not affect the serial port and the CVI application runs fine.
0 Kudos
Message 1 of 4
(3,558 Views)
Hi Jeff,

It may be worthwhile to implement a multithreaded application. You can create a thread to handle the UI, while the other thread handles the serial communication. The thread pool is a simple way to easily create multiple threads. This feature allows the user to create a pool of threads that can be assigned to different tasks by associating different threads from the pool with different functions. Also, an asynchronous timer is a good way to execute a particular function at regular intervals while doing other tasks at the same time. The asynchronous timer functions are in a function panel (asynctmr.fp) that must be loaded with the project. The asynchronous timer uses the Windows multimedia timer which has a minimum interval of about 10ms (depending on you
r system) and handles all the asynchronous calls with one thread. For this reason, it is advised to only use one asynchronous timer. If more are needed, use the thread pool. Hope this helps!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 4
(3,558 Views)
How are you implementing your app, serial port stuff in particular.
Moving the mouse shouldn't affect serial port. I do it all the time, on
windows2000 and win XP.

Problems I have seen the other way, where serial port stuff hangs up the
GUI. Default timeouts in CVI are order of 5 seconds and CVI RS232
functions block during that time, freezing the GUI. Simple option is to
reduce timeout values, and use your own timeout function which will try
serial I/O for a given amount of time (and calling procesSystemEvents
inside). Multi-threading is another option.

jeff at parker wrote:
> our CVI application uses the serial port to communicate with a product
> we are designing. moving the mouse dirupts the serial function.
> however if we configure the short cut in w
indows XP compatipility mode
> to windows 98 the mouse does not affect the serial port and the CVI
> application runs fine.
0 Kudos
Message 3 of 4
(3,558 Views)
Vishi Anand schrieb:
> How are you implementing your app, serial port stuff in particular.
> Moving the mouse shouldn't affect serial port. I do it all the time, on
> windows2000 and win XP.
>
> Problems I have seen the other way, where serial port stuff hangs up the
> GUI. Default timeouts in CVI are order of 5 seconds and CVI RS232
> functions block during that time, freezing the GUI. Simple option is to
> reduce timeout values, and use your own timeout function which will try
> serial I/O for a given amount of time (and calling procesSystemEvents
> inside). Multi-threading is another option.
>
> jeff at parker wrote:
>
>> our CVI application uses the serial port to communicate with a product
>> we are designing. moving the mouse dirupts the serial
function.
>> however if we configure the short cut in windows XP compatipility mode
>> to windows 98 the mouse does not affect the serial port and the CVI
>> application runs fine.
>
>

I remember, that I had such problems with an old PC. I had an internal
modem card (which is than com3), and this card did not work correctly
when I use it with my serial mouse on com1. Com1 and com3 used the same
irq and this was the problem.
Switching the mouse to com2 solved this problem.

Stephan
0 Kudos
Message 4 of 4
(3,558 Views)