Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Fixed caused by passing wrong arg #1336

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pymodbus/repl/client/mclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def readwrite_registers(
read_count,
write_address,
write_registers,
unit=Defaults.Slave,
slave=Defaults.Slave,
**kwargs,
):
"""Read `read_count` number of holding registers.
Expand All @@ -236,7 +236,7 @@ def readwrite_registers(
:param read_count: Number of registers to read
:param write_address: register offset to write to
:param write_registers: List of register values to write (comma separated)
:param unit: Modbus slave unit ID
:param slave: Modbus slave unit ID
:param kwargs:
:return:
"""
Expand All @@ -245,7 +245,7 @@ def readwrite_registers(
read_count=read_count,
write_address=write_address,
write_registers=write_registers,
unit=unit,
slave=slave,
**kwargs,
)
if not resp.isError():
Expand All @@ -257,20 +257,20 @@ def mask_write_register(
address=0x0000,
and_mask=0xFFFF,
or_mask=0x0000,
unit=Defaults.Slave,
slave=Defaults.Slave,
**kwargs,
):
"""Mask content of holding register at `address` with `and_mask` and `or_mask`.

:param address: Reference address of register
:param and_mask: And Mask
:param or_mask: OR Mask
:param unit: Modbus slave unit ID
:param slave: Modbus slave unit ID
:param kwargs:
:return:
"""
resp = super().mask_write_register( # pylint: disable=no-member
address=address, and_mask=and_mask, or_mask=or_mask, unit=unit, **kwargs
address=address, and_mask=and_mask, or_mask=or_mask, slave=slave, **kwargs
)
if not resp.isError():
return {
Expand Down Expand Up @@ -303,14 +303,14 @@ def read_device_information(self, read_code=None, object_id=0x00, **kwargs):
}
return ExtendedRequestSupport._process_exception(resp)

def report_slave_id(self, unit=Defaults.Slave, **kwargs):
def report_slave_id(self, slave=Defaults.Slave, **kwargs):
"""Report information about remote slave ID.

:param unit: Modbus slave unit ID
:param slave: Modbus slave unit ID
:param kwargs:
:return:
"""
request = ReportSlaveIdRequest(unit, **kwargs)
request = ReportSlaveIdRequest(slave, **kwargs)
resp = self.execute(request) # pylint: disable=no-member
if not resp.isError():
return {
Expand Down