LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rs-232 comunication

Hi.

I have problems with the rs232 comunication. When I receive datas in large

quatites and my aplication
is active the comunication works very well. The problem apairs when I

activate another windows aplication (word, notepad, ... enything).
In that moment I begin to lose information. I think that my aplication

don't pay atention anymore at the comunication port (it is busy with

opening that other aplication )so the datas is lost.

How can I prevent this?

Thanks.
0 Kudos
Message 1 of 4
(3,452 Views)
Here are three areas that affect your applications ability to process incoming data.
1. The amount of time you spend in your Com callback. A callback cannot be called recursively. You won't be able to read new data at the com port until you return from the previous call to the Com callback. Do only essential tasks in your callback. If the other suggestions below don't help enough, consider creating a multi-threaded application and off-load most of the processing tasks to another thread.
2. The amount of time Windows spends on other applications. Look at the help for SetSleepPolicy. The default is VAL_SLEEP_MORE. Try using VAL_SLEEP_LESS or, as a last resort, VAL_SLEEP_NONE. Be careful sleeping LESS or NONE: this will affect the performance of all other Windows a
pplications.
3. The Input Queue Size, specified with OpenComConfig(). If you make the Queue Size larger, you'll have more time to process your data. The Queue is in hardware, so other Windows applications won't affect data going into the queue. Data is lost if the queue gets filled. A larger queue will take longer to fill. Your application can come back later without losing data. There is no maximum limit on the Input Queue Size.
0 Kudos
Message 2 of 4
(3,453 Views)
Try to install a callback function for your communication, means only when
the rs232 port get something, your programm will read the input data
otherwise do nothing. Maybe the conflict with other application can be
solved.

"tmaxial" wrote in message
news:506500000008000000D1010100-1079395200000@exchange.ni.com...
> Hi.
>
> I have problems with the rs232 comunication. When I receive datas in
> large
>
> quatites and my aplication
> is active the comunication works very well. The problem apairs when I
>
> activate another windows aplication (word, notepad, ... enything).
> In that moment I begin to lose information. I think that my aplication
>
> don't pay atention anymore at the comunication port (it is busy with
>
> opening that other aplic
ation )so the datas is lost.
>
> How can I prevent this?
>
> Thanks.
0 Kudos
Message 3 of 4
(3,452 Views)
I see that you've posted this question again. Have you tried my suggestions in this thread?
0 Kudos
Message 4 of 4
(3,435 Views)