Im new to Modbus python and now i have some questions about my first steps
The Script:
from pymodbus.client.sync import ModbusTcpClient
host = '10.8.3.10'
port = 502
client = ModbusTcpClient(host, port)
client.connect()
#Register address 0x102A (4138dec) with a word count of 1
#Value - MODBUS/TCP Connections
#Access - Read
#Description - Number of TCP connections
request = client.read_holding_registers(0x3E8,10,unit=0)
response = client.execute(request)
print response
#print response.registers
print response.getRegister(12)
print response.registers[8]
client.close()
The result:
============= RESTART: D:\Users\mxbruckn\Desktop\read_modbus.py =============
ReadRegisterResponse (38)
0
0
>>>
Now the questions:
I read from Register 1000, 10 Words, with slave number 0. is this correct, but what means the value 38
How can i read 2 Words from register 1007? my code does not work: (0x3EF,2, unit=0) Exception Response(131, 3, IllegalValue)
Ciao, Doc