api write_coils returns Exception
Closed this issue · 3 comments
andyhebiao commented
Versions
- Python: 3.11
- OS: win10 22H2
- Pymodbus: 3.7.4
- Modbus Hardware (if used):
Pymodbus Specific
class pymodbus.client.serial.ModbusSerialClient
methode write_coils
Description
trying to write coils, doesn't work, the response shows "Exception Response(143, 15, IllegalAddress)". The other APIs for read single coil, read discret register, read registers works with the same parameters.
Code and Logs
# call API and then print the response
# please use the following to format logs when posting them here
client = ModbusSerialClient(port='COM10', baudrate=9600, timeout=1, parity='N', stopbits=1, bytesize=8)
client.connect()
# call client.write_coils returns always exception
print("response of write coils api:", client.write_coils(address=0, values=[True] * 10, slave=14))
# call client.write_register works with out problem.
print("response of write register api:", client.write_registers(address=100, values=[456, 789], slave=14))
pycharm run window show log:
response of write coils api: Exception Response(143, 15, IllegalAddress)
response of write register api: WriteMultipleRegisterResponse (100,2)
janiversen commented
I think this is solved on dev, but I will check.
janiversen commented
Works with current dev.
andyhebiao commented
thanks a lot :-) @janiversen