'Why is the Value being Read from the Register Constantly Zero? (Pymodbus)
I am trying to read the value of a holding register using Pymodbus in a python script. I know what the value in the register is (8500), but in the python script I keep getting 0.
See Below:
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.payload import BinaryPayloadDecoder
client = ModbusClient('IPaddress')
connection = client.connect()
if connection:
response = client.read_holding_registers(0x00, 4, unit=1)
print(response.registers)
----------------------------------------------------------------
result = [0,0,0,0]
Can anybody help, or know what's wrong?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
