Re: pySerial Windows write problem
- From: "Bob Greschke" <bob@xxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 21:55:35 -0600
"Peter Hansen" <peter@xxxxxxxxxxx> wrote in message >
> Actually, I'm curious why you don't do the same. I'd call it very unusual
> (in my experience) to have a program open and close a serial port
> repeatedly. Among other things, this means that the DSR/DTR lines are
> toggling high and low repeatedly, and that alone could cause undesirable
> behaviour in certain devices.
I guess I could. It's just that not releasing the port/not KNOWING that the
port has been closed at predictible times is our chief complaint about the
C++ program. As an aside, when I left work I left a version of the
while-loop program running, opening the port, writing to the equipment,
getting a response, and closing the port. It was up to about 180 sucessful
cycles (in a row -- it will stop if it fails). I think it's a hardware
problem. :)
> In none of my own serial-based programs (perhaps a few dozen such to date)
> have I ever opened and closed a port other than at startup and shutdown
> (just as your C++ program does). Unless you've got a good reason to do
> otherwise, if this solves your problem it's certainly the most direct
> approach to do so.
One of the serial ports (there are actually two) is used to read some NMEA
sentences from a GPS. It is only rarely read. If it is also opened when
the program starts and kept open would you just dump the buffer and then
read to get the most current info? What happens when the buffer fills up?
The "main" port is just commands sent, responses received kind of traffic.
I'd write a C extension to do the serial stuff, but I don't know a thing
about Windows programming.
Thanks!
.
- References:
- pySerial Windows write problem
- From: Bob Greschke
- Re: pySerial Windows write problem
- From: Peter Hansen
- Re: pySerial Windows write problem
- From: Bob Greschke
- Re: pySerial Windows write problem
- From: Peter Hansen
- pySerial Windows write problem
- Prev by Date: Re: Multithreaded class with queues
- Next by Date: Weekly Python Patch/Bug Summary
- Previous by thread: Re: pySerial Windows write problem
- Next by thread: poplib.POP3.list() returns extra value?
- Index(es):
Relevant Pages
|