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

Typo arround no_response_expected #2550

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions doc/source/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ The logical devices represented by the device is addressed with the :mod:`slave=
With **Serial**, the comm port is defined when creating the object.
The physical devices are addressed with the :mod:`slave=` parameter.

:mod:`slave=0` is defined as broadcast in the modbus standard, but pymodbus treats is a normal device.
:mod:`slave=0` is defined as broadcast in the modbus standard, but pymodbus treats it as a normal device.

If an application is expecting multiple responses to a broadcast request, it must call :mod:`client.execute` and deal with the responses.

If no response is expected to a request, the :mod:`no_response_expected=True` argument can be used
in the normal API calls, this will cause the call to return imidiatble with :mod:`None`
in the normal API calls, this will cause the call to return immediately with :mod:`None`.


Client response handling
Expand All @@ -224,7 +224,7 @@ The application should evaluate the result generically::
raise ModbusException(txt)

:mod:`except ModbusException as exc:` happens generally when pymodbus experiences an internal error.
There are a few situation where a unexpected response from a device can cause an exception.
There are a few situation where an unexpected response from a device can cause an exception.

:mod:`rr.isError()` is set whenever the device reports a problem.

Expand Down Expand Up @@ -257,7 +257,7 @@ There are a client class for each type of communication and for asynchronous/syn

Client common
^^^^^^^^^^^^^
Some methods are common to all client:
Some methods are common to all clients:

.. autoclass:: pymodbus.client.base.ModbusBaseClient
:members:
Expand Down Expand Up @@ -323,7 +323,7 @@ Modbus calls

Pymodbus makes all standard modbus requests/responses available as simple calls.

Using Modbus<transport>Client.register() custom messagees can be added to pymodbus,
Using Modbus<transport>Client.register() custom messages can be added to pymodbus,
and handled automatically.

.. autoclass:: pymodbus.client.mixin.ModbusClientMixin
Expand Down
6 changes: 3 additions & 3 deletions pymodbus/client/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class ModbusClientMixin(Generic[T]): # pylint: disable=too-many-public-methods
Advanced modbus message call::

request = ReadCoilsRequest(1,10)
response = client.execute(request)
response = client.execute(False, request)
# or
request = ReadCoilsRequest(1,10)
response = await client.execute(request)
response = await client.execute(False, request)

.. tip::
All methods can be used directly (synchronous) or
Expand All @@ -51,7 +51,7 @@ def __init__(self):
"""Initialize."""

@abstractmethod
def execute(self, no_response_expected: bool, request: ModbusPDU,) -> T:
def execute(self, no_response_expected: bool, request: ModbusPDU) -> T:
"""Execute request."""

def read_coils(self, address: int, *, count: int = 1, slave: int = 1, no_response_expected: bool = False) -> T:
Expand Down
Loading