Hi All,

I am running Python 2.5 on Windows and I have an issue/problem whilst 
accessing/using a serial port. I have a piece of test equipment that needs a 
control line to enable/disable its power. So I have connected the DTR of a 
serial port to my equipment and I can happily control power by opening the 
serial port and then enabling/disabling the DTR line (using pySerial). However, 
occasionally I get an exception raised (win32file.EscapeCommFunction 
(self.hCommPort, win32file.SETDTR), pywintypes.error : (5, 
'EscapeCommFunction', 'Access is Denied') ) From what I can gather, this 
exception is raised when the resource in question (in this case my serial port) 
if already in use by another entity. Now that's fine, but no other process / 
application on the machine is (to the best of my knowledge) accessing this 
serial port. My application is single threaded.

The frequency with which this issue occurs also leaves me little in the way of 
clues - I can run the SW for 3 days or so until it happens or it will run for 
only about 12-hours before I run into trouble.

Can anyone offer any insights into this either in terms of telling me why this 
may be happening or suggest how I may gather some info from the system as to 
who or what currently has the serial port 'locked'.

As the serial port is giving me 'access denied' I am also a little unsure of 
what is a sensible course of action. If the port is not under my control, then 
I may not be able to close it. If I can't close it then I may be in a spot of 
bother regarding a path for recovery from this situation.

Any help appreciated.

Regards

Andy Atkinson
BEGIN:VCARD
VERSION:2.1
N:Atkinson;Andy
FN:Andy Atkinson
ORG:Hydrix Pty Ltd
TITLE:Software Team Leader
TEL;WORK;VOICE:+61 3 8573 5214
TEL;WORK;FAX:+61 3 8573 5214
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;1044a Dandenong Road=0D=0ACarnegie;Melbourne;Victoria;3163;Australia
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:1044a Dandenong Road=0D=0ACarnegie=0D=0AMelbourne, Victoria 3163=0D=0AAustra=
lia
URL;WORK:http://www.hydrix.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20071022T035422Z
END:VCARD
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to