pySerial Windows write problem
Bob Greschke
bob at passcal.nmt.edu
Thu Jul 28 19:00:11 EDT 2005
"Peter Hansen" <peter at engcorp.com> wrote in message
news:rfCdnZHOGsnDwXTfRVn-gg at powergate.ca...
> Bob Greschke wrote:
> > But writing anything to the port
>> quickly (not always right away...like maybe 5-6 iterations through the
>> loop?) causes the
>>
>> win32file.CloseHandle(self.hComPort)
>>
>> statement in the 'def close(self)' function of the serialwin32.py file of
>> the pySerial package to hang for a few seconds, then return.
>
> Are you certain it is this line that is blocking, and not the preceding
> line which is a call to SetCommTimeouts()? How did you prove which line
> it is? (I don't have an answer to the problem, just wanted to be sure of
> the information...)
>
> -Peter
Hi!
I had the SetCommTimeouts line commented out. I just have a couple of
prints before and after the CloseHandle line.
I didn't write the C++ program, but it looks like it never closes the serial
port. It opens it when it starts up, then keeps it open until it quits.
Tsk tsk tsk. Sloppy. Maybe they did that to cover up this problem. :)
Bob
More information about the Python-list
mailing list