-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
HI,sorry for my poor english!
Why my tcp client get none after perfoming function 'read_input_registers'?My code is:
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
import logging
logging.basicConfig()
log = logging.getLogger()
log.setLevel(logging.DEBUG)
client = ModbusClient('192.1.8.146', port=26)
client.connect()
arguments = {
'read_address': 0,
'read_count': 1,
'write_address': 1,
'write_registers': 1,
}
rq = client.readwrite_registers(**arguments)
rr = client.read_input_registers(0,16)
print rr
client.close()
The result is:
DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.transaction:0x4d 0x4f 0x44 0x42 0x55 0x53
DEBUG:pymodbus.transaction:getting transaction 1
DEBUG:pymodbus.transaction:Running transaction 2
DEBUG:pymodbus.transaction:0x0 0x2 0x0 0x0 0x0 0x23 0x1 0x4 0x20 0x9a 0xf9 0x79 0xc4 0x9a 0xf9 0x79 0xc4 0x9a 0xf9 0x79 0xc4 0x9a 0xf9 0x79 0xc4 0x9a 0xf9 0x79 0xc4 0x0 0x0 0xc0 0x41 0x9a 0xf9 0x79 0xc4 0x66 0x66 0xbe 0x41
DEBUG:pymodbus.transaction:getting transaction 2
None
I use a modbus/tcp to modbus/rtu gatway as a server,i test it with Modbus Poll,it can get the correct datas,i am sure the device is ok,so i don't know where is going wrong...
Thank you!
Billy apple
Metadata
Metadata
Assignees
Labels
No labels