Issue with COM port in rtumaster_example.py

95 views
Skip to first unread message

Dexter

unread,
Mar 3, 2011, 5:57:48 AM3/3/11
to modbus-tk
In the the above mentioned file if the setting is done to use port 4
as shown below the actual port used will be PORT5

master = modbus_rtu.RtuMaster(serial.Serial(port=4, baudrate=9600,
bytesize=8, parity='N', stopbits=1, xonxoff=0))

I think this is a simple bug and is introduced when passing the port
value to serialwin32.py.
Was a bit busi could not go through the source code yet

Regards
PK

luc

unread,
Mar 3, 2011, 7:17:44 AM3/3/11
to modbus-tk
Hello,
In pyserial the number of the devices starts at 0. so COM1 is port 0.
But you can use the port name port='COM1'. See
http://pyserial.sourceforge.net/pyserial_api.html#serial.Serial
I hope it helps
Best Regards
luc
Reply all
Reply to author
Forward
0 new messages