I have been using pymodbus now for a couple of years in many different platforms to read out and store data from different sources into a dashboard program. Recently, I enabled one of our Allen Bradley PLCs to relay some info through ModbusTCP and notices that when I request to read a specific register, it then sends me all the enabled registers data. Here is my code for your analysis:
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
client = ModbusClient('xxx.xxx.xxx.xxx',502)
client.connect()
Returns True
info = client.read_input_registers(0,1)
info.registers
Returns 13 register values instead of one.
In my application, I store all the needed registers in a database that is queried register by register until all data is loaded. Is there a way I can get to read only one register (the one specified by read_input_registers) at a time?
Hi,
I have been using pymodbus now for a couple of years in many different platforms to read out and store data from different sources into a dashboard program. Recently, I enabled one of our Allen Bradley PLCs to relay some info through ModbusTCP and notices that when I request to read a specific register, it then sends me all the enabled registers data. Here is my code for your analysis:
from pymodbus.client.sync import ModbusTcpClient as ModbusClient client = ModbusClient('xxx.xxx.xxx.xxx',502) client.connect()
Returns True
info = client.read_input_registers(0,1) info.registers
Returns 13 register values instead of one.
In my application, I store all the needed registers in a database that is queried register by register until all data is loaded. Is there a way I can get to read only one register (the one specified by read_input_registers) at a time?
Thanks for any help you can provide.