Re: pyserial question

Discussion in 'Python' started by Dennis Lee Bieber, Jun 19, 2009.

  1. On Thu, 18 Jun 2009 14:24:42 +0300, Piter_ <> declaimed
    the following in gmane.comp.python.general:

    > Hi all.
    > I try to control some equipment from python trough comport.
    > I have not succeeded in pyserial. But if I use this terminal:
    > http://hw-server.com/files/priloha/termv19b.zip
    > http://hw-server.com/software/termv19b.html
    > It works with following settings.
    > Boud rate: 9600
    > Data bids: 8
    > Parity: none
    > stop bids: 1
    > Handshaking: RST on TX
    >
    > I cant find out how to set "Handshaking RST on TX" in pyserial.


    Never encountered "RST" mode... "RTS" mode is common.

    >From the source -- a port can be initialized with:


    def __init__(self,
    port = None, #number of device, numbering
    starts at
    #zero. if everything fails, the
    user
    #can specify a device string,
    note
    #that this isn't portable
    anymore
    #port will be opened if one is
    specified
    baudrate=9600, #baudrate
    bytesize=EIGHTBITS, #number of databits
    parity=PARITY_NONE, #enable parity checking
    stopbits=STOPBITS_ONE, #number of stopbits
    timeout=None, #set a timeout value, None to
    wait forever
    xonxoff=0, #enable software flow control
    rtscts=0, #enable RTS/CTS flow control
    writeTimeout=None, #set a timeout for writes
    dsrdtr=None, #None: use rtscts setting,
    dsrdtr override if true or false
    interCharTimeout=None #Inter-character timeout, None
    to disable
    ):

    If RTS/CTS is not doing what you need... You may have to go very
    low-level -- programmatically setting and clearing the control lines.

    def setRTS(self, level=1):
    """Set terminal status line: Request To Send"""
    if not self.hComPort: raise portNotOpenError
    if level:
    self._rtsState = win32file.RTS_CONTROL_ENABLE
    win32file.EscapeCommFunction(self.hComPort,
    win32file.SETRTS)
    else:
    self._rtsState = win32file.RTS_CONTROL_DISABLE
    win32file.EscapeCommFunction(self.hComPort,
    win32file.CLRRTS)


    Again, both of those clips are readily viewable by just looking at
    the .py files in the serial package.
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Jun 19, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diez B. Roggisch

    Pyserial question

    Diez B. Roggisch, Jan 5, 2004, in forum: Python
    Replies:
    1
    Views:
    404
    Kelia Nichols
    Jan 5, 2004
  2. David Goodger

    Re: Pyserial question

    David Goodger, Jan 5, 2004, in forum: Python
    Replies:
    0
    Views:
    445
    David Goodger
    Jan 5, 2004
  3. jorjun
    Replies:
    1
    Views:
    643
    John P. Speno
    Jan 8, 2004
  4. Replies:
    3
    Views:
    412
  5. Jean Dupont
    Replies:
    2
    Views:
    335
    Peter
    Feb 8, 2012
Loading...

Share This Page