pyserial and com port interrupts

engsol engsolnorm at peak.org
Wed Jan 12 21:02:49 EST 2005


On Wed, 12 Jan 2005 17:45:48 -0500, Peter Hansen <peter at engcorp.com> wrote:

>engsol 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.
>
>What problem do you hope to avoid by not using "polling
>and timeouts"?  (Note that if you specify a sizable
>read timeout, you're closer to being interrupt-driven
>than you are to what is traditionally called "polling".)
>
>-Peter

Peter,
Thanks for the reply. I'm working on a s/w test program using python
code. Com1 and com2 play a part. The problem is that the python code
has a lot of work to do...and the results from the hardware under test can
come from either com1 or com2...at any time. It may be a few milliseconds, 
or several seconds, sometimes minutes, before a response is expected. 
I'm not sure what timeout value I'd use. Using threads, and re-loading the
timeout values on the fly may be a solution, but I'm not experienced with
threads....and was hoping to avoid them.
Norm B



More information about the Python-list mailing list