Search code examples
pythonmodbusmodbus-tcp

PyModbus - Read_holding_coils returns strange value


I have written the following little block of code:

from pymodbus.client.sync import ModbuTcpClient

def test(client):
   client.connect()
   print client.read_holding_registers(10, 1, unit=10)
   client.close()

test(client)

.

The output I get from print is:

ReadRegisterResponse (1)

.

Why am I getting this and not the actual value (integer/string) the register is holding?

Thanks for the answers!


Solution

  • You asked for 1 register at address 10 and got a response that says the value at address 10 is 1. What were you expecting to be different?