Win32/Python serial port event character problem

Derek Basch dbasch at yahoo.com
Sat Jun 29 21:45:43 CEST 2002


Sorry to post this again but it didn't get any
responses. Maybe better luck this time.

I use the following code to read data from the serial
port when a certain event character ('\n') is
received:
http://www.geocities.com/dbasch/temp.txt

It seems to work fine except for that when I send the
following data via the serial port:
http://www.geocities.com/dbasch/testdata.txt

the output is:

Comport Thread:test 1
Comport Thread:
test 2
te
Comport Thread:st 3
tes
Comport Thread:t 4
test 5

It seems to me that in the time between the event
character being received and the ReadFile operation
occurring additional characters are being placed into
the windows OS serial buffer.
Has anyone ever dealt with this? Is using the event
character not a reliable method in windows?
I know the event character is being triggered because
I can change the event character to 'g' and nothing
happens unless a 'g' is in the received data.
I have obviously left out some of the code in the
example but I hope everyone will understand it ok.
This is driving me batty so any help is greatly
appreciated.
Thanks,
Derek Basch
1 very unskilled win32 programmer.


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com





More information about the Python-list mailing list