Skip to content

'ModbusIOException' object has no attribute 'registers' #437

Closed
@Howeng98

Description

Versions

  • Python: 3.7
  • OS: Linux
  • Pymodbus: 1.3.1
  • Pymodbus3: 1.0.0
  • Modbus Hardware (if used):

Description

I want to use Modbus to execute JY-CZ1000-GN. And I use the code as below, and It can't worked. The point is it can worked last time (a few weeks ago),but now cannot.
I wonder that maybe it is not the software(code) problem, should be handware problem, I guess it is the wire didn't connect to ground ,so when we try to read register will received some circuit noise(?)

Code and Logs

Code:
from pymodbus.client.sync import ModbusSerialClient as ModbusClient

scale = ModbusClient(method='rtu', port='/dev/ttyUSB0', parity='N', baudrate=9600, bytesize=8, stopbits=2, timeout=1)
connection = scale.connect()

try:
result = scale.read_holding_registers(0,10, unit=1)
print(result)
print(result.registers)
except Exception as e:
print(e)

scale.close()

Error Message:
Modbus Error: [Input/Output] No Response received from the remote unit
'ModbusIOException' object has no attribute 'registers'

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions