Serial.py woes

Norbert Klamann Norbert.Klamann at klamann-software.de
Wed Nov 27 02:05:17 EST 2002


John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote in message news:<mailman.1038360999.28458.python-list at python.org>...
> I am using Roger Burnhams SioModule22 to interface with a RS232
> medical device.  I can do a basic handshake with the device and
> nothing more.  All other commands that I attempt are ignored (no data
> sent back).  The basic handshake is: I send a CR, it sends back a
> '*'.  

[details snipped]

> 
> Any and all advice much appreciated.

So be it:

Maybe this post can help you :

http://groups.google.com/groups?selm=r77ooukb98cbfbpcqbitl9g53vuokkl79s%404ax.com&output=gplain

The thing works for me, I by myself am no specialist for serial lines
either.

But the point could be the loop in this function

[from the above mentioned post]

def readuntilok(s):
    ol=[]
    while 1:
        c=s.read()
        if not c:
            break
        ol.append(c)
        ostring="".join(ol)
        if len(ol)>3 and ostring[-4:]=="OK\r\n":
            break
    return ostring


HTH


Norbert Klamann

> 
> For the old-timers, the device is a Neurostar Ms92B.


Whats that ???? <grin>
> 
> John Hunter
> 
> python2.2



More information about the Python-list mailing list