pyserial and com port interrupts

Stephen Thorne stephen.thorne at gmail.com
Wed Jan 12 22:26:54 EST 2005


On Thu, 13 Jan 2005 03:11:23 GMT, Bengt Richter <bokr at oz.net> wrote:
> On Wed, 12 Jan 2005 14:24:48 -0800, engsol <engsolnorm at peak.org> wrote:
> 
> >Has anyone done a script that will rspond to the serial com port(s)
> >receive buffer interrupt, as opposed to polling and timeouts?
> >Win2000 is the main interest right now.
> 
> Have you looked into letting the OS do it? I.e., reading from COM4:
> or whatever port in a thread maybe one byte at a time? Maybe you can
> get your end functionality without writing low levels stuff, depending ;-)
> 
> I haven't done this, but it seems an easy thing to try a few experiments with.
> The control panel should let you set baud rates and handshaking etc. I would think.

PySerial[1] is more than capable of handling all the low level
operations with little more than 's.baud = 9600'. The OP was more
interested in how to write his program so he could react to com port
input in a timely manner in the face of having blocking procedures
elsewhere in his code.

Regards,
Stephen Thorne

[1] http://pyserial.sourceforge.net/



More information about the Python-list mailing list