recv_MBAP error output by write_single_coil()

204 Views Asked by At

I am encountering this error on the output : _recv MBAP error

My code is like this

from pyModbusTCP.client import ModbusClient


c = ModbusClient('192.168.0.7', port=502, debug=True, auto_open=True, auto_close=False)

if c.is_open == False:
            print('not connected')
else:
            print('connected')

print(c.unit_id())

c.write_single_coil(0,True)

and the output is this:

connected
1
Tx
[4A 62 00 00 00 06 01] 05 00 00 FF 00 
timeout error
_recv MBAP error

I tried to ping the IP address of the PLC and it returns a reply. Also i tried to replace the cable. The issue is still the same.

0

There are 0 best solutions below