Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: pyserial question

Reply
Thread Tools

Re: pyserial question

 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      06-19-2009
On Thu, 18 Jun 2009 14:24:42 +0300, Piter_ <(E-Mail Removed)> 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://www.velocityreviews.com/forums/(E-Mail Removed) (E-Mail Removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (E-Mail Removed))
HTTP://www.bestiaria.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pySerial question, setting certain serial parameters [newbie] Jean Dupont Python 2 02-08-2012 12:16 AM
Beginner Pyserial Question JAMoore84@gmail.com Python 3 01-24-2008 05:45 PM
pyserial with Mac and USB converter, possible? jorjun Python 1 01-08-2004 02:43 PM
Re: Pyserial question David Goodger Python 0 01-05-2004 04:10 PM
Pyserial question Diez B. Roggisch Python 1 01-05-2004 03:59 PM



Advertisments