Re: pySerial Windows write problem



"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!


.



Relevant Pages

  • Re: Serial Communications - Lost Event
    ... "Completion of write" is a moment when all data from the app buffer is ... The driver can keep the data in its internal buffer ... > serial port monitoring and test applications. ... > of a serial port means when all of the data has been transfered. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: thread related issue
    ... from serial port and display it.so i created one thred for this work. ... to properly terminate the buffer. ... The proper types are ... Take a look at my essay on serial port I/O on my MVP Tips site. ...
    (microsoft.public.vc.mfc)
  • Re: roZetta Status
    ... roZetta firmware is written in ZBasic and uses the ZX-40 from Elba, ... There is one main highspeed RS232 level serial port which interfaces ... with the TW523 as the ZX-40's interrupts are sluggish about 3% of the time. ...
    (comp.home.automation)
  • thread related issue
    ... from serial port and display it.so i created one thred for this work. ... sending the data also i.e. buffer so please help me ... DWORD length=0; ...
    (microsoft.public.vc.mfc)
  • Re: How to Disable Ethernet
    ... you can use the serial port as an alternative method of getting debug. ... can disable KITL debugging and just read all of the messages that come out. ...
    (microsoft.public.windowsce.platbuilder)