Skip to content

Passing in a device_id to read_holding_registers causes error got an unexpected keyword argument 'device_id' #2609

Closed as not planned
@8none1

Description

@8none1

I'm using version 3.8.6 from pip and talking to an EW11 modbus TCP adapter.

According to the docs I can pass in a device_id.

However, when I do this I get the error:

TypeError: ModbusClientMixin.read_holding_registers() got an unexpected keyword argument 'device_id'

When ommiting device_id altogether things work as expected.

Example code

from pymodbus.client import ModbusTcpClient
c = ModbusTcpClient(host="hostname")
c.connect()
r = c.read_holding_registers(47, count=7, device_id=1)

Error

Traceback (most recent call last):
  File "<python-input-4>", line 1, in <module>
    r = c.read_holding_registers(47, count=7, device_id=1)
TypeError: ModbusClientMixin.read_holding_registers() got an unexpected keyword argument 'device_id'

Metadata

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