Server Timers vs. Windows Timers for RS232 polling 
Author Message
 Server Timers vs. Windows Timers for RS232 polling

Some days ago I had a problem (posted in this ng) and today I found
the solution, but I cannot explain very well how (and why) it does
work now.

The problem:
In a windows form I receive and display data (packet of bytes) coming
from a RSR232 port (100 byte per second).
The problem: when I resize the form (a MDI child) I get a CRC error
for the incoming data, this means the byte packet was damaged!

The solution:
I replaced the Server Timer used to poll the serial with a Windows
Timer

A server timer should work in a own thread and for this reason more
appropriate foot data polling! Or am I not understanding the
difference?

Thank you for your reply.



Tue, 02 Aug 2005 18:06:31 GMT  
 Server Timers vs. Windows Timers for RS232 polling

Quote:
> The solution:
> I replaced the Server Timer used to poll the serial with a Windows
> Timer

May I ask why you are polling?  The MSCOMM control is event driven, you will
have a much more reliable solution if you utilise this.

Nick.



Tue, 02 Aug 2005 19:26:35 GMT  
 Server Timers vs. Windows Timers for RS232 polling

Quote:

>May I ask why you are polling?  The MSCOMM control is event driven, you will
>have a much more reliable solution if you utilise this.

The serial device answers when I send the char "s". So I have to send
a char each time interval:

Private Sub tmrADC_Elapsed(....) Handles tmrADC.Elapsed
            If MSComm.PortOpen Then
                MSComm.Output("s")
                Do Until MSComm.InBufferCount >= 10
                    DoEvents() (??? i do not know if is ok)
                Loop
                ProcessInput(MSComm.Input)
            Else
                tmrADC.Stop()
            End If
    End Sub



Tue, 02 Aug 2005 20:18:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Windows Service with System.Timers.Timer

2. Communications thru RS232 and Timer controls

3. Communications thru RS232 links and Timer Control

4. Communications thru RS232 links and Timer Control

5. Timer Control under Windows NT4 Server

6. system.timers.timer bug found

7. System.Timers.Timer in VB .NET ignores errors

8. Benefits of the timer object, bompared to the timer control

9. better timer than Timer?

10. timer event within a timer event

11. Q: Timer problem (need simple count up timer)

12. Timer interval is depending on code in timer event

 

 
Powered by phpBB® Forum Software