On Wed, 12 Jan 2005 17:45:48 -0500, Peter Hansen <pe***@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
Reliably Reading from the Serial Port in Python. Ask Question Asked 4 years, 11 months ago. I'm working on the very basic stage of this which is simply RPi2 listening to the serial port and printing whatever it recieves. My code is as follows. Browse other questions tagged python serial.