simat / modbus-tk

Automatically exported from code.google.com/p/modbus-tk
Other
0 stars 0 forks source link

write multiple coils problem? #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

maybe the following behavior is not ok

1. setup a tcp modbus server and install a coils bank on address 1
2.try the following sequence of command with a client script:

print m.execute(1, cst.READ_COILS, 15, 4)
print m.execute(1, cst.WRITE_MULTIPLE_COILS, 15, 4, [1,1,1,1])
print m.execute(1, cst.READ_COILS, 15, 4)
print m.execute(1, cst.WRITE_MULTIPLE_COILS, 15, 2, [0,0])
print m.execute(1, cst.READ_COILS, 15, 4)

the final output is  (0,0,0,1) 
i think it should be (0,0,1,1)

maybe the problem is modbus.py  Slave._write_multiple_coils
the inner loop boundary set a bit more.

regards

franz

Original issue reported on code.google.com by dr.sh...@gmail.com on 14 Nov 2012 at 5:10