Skip to content

Commit

Permalink
Remove param.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Sep 9, 2024
1 parent 7fa56a4 commit 3146d82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 0 additions & 3 deletions pymodbus/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,6 @@ def _unpack_words(self, handle) -> bytes:
# Change Word order if little endian word order #
# Pack values back based on correct byte order #
# ---------------------------------------------- #
:param handle: Value to be unpacked
:return:
"""
if Endian.LITTLE in {self._byteorder, self._wordorder}:
handle = array("H", handle)
Expand Down
16 changes: 13 additions & 3 deletions pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@
# The Global Transaction Manager
# --------------------------------------------------------------------------- #
class ModbusTransactionManager:
"""Implement a transaction for a manager.
"""Implement a transaction manager.
Results are keyed based on the supplied transaction id.
Only 1 request can be active at any time, the reasoning being:
- of the 4 official framer types only socket support transactions
- Only few devices with tcp/ip accept multiple transactions
- majority of these devices simply queue the requests, no parallel execution
So in total it is a very low percentage that would benefit from a proper transaction handler,
meaning it does not make sense to support it.
The transaction manager support multiple client requests with automatic queing!
"""

def __init__(self):
Expand Down Expand Up @@ -136,7 +145,7 @@ class SyncModbusTransactionManager(ModbusTransactionManager):
def __init__(self, client: ModbusBaseSyncClient, retries):
"""Initialize an instance of the ModbusTransactionManager."""
super().__init__()
self.client: ModbusBaseSyncClient = client
self.client = client
self.retries = retries
self._transaction_lock = RLock()
self._no_response_devices: list[int] = []
Expand All @@ -146,6 +155,7 @@ def __init__(self, client: ModbusBaseSyncClient, retries):
def _set_adu_size(self):
"""Set adu size."""
# base ADU size of modbus frame in bytes

if isinstance(self.client.framer, ModbusSocketFramer):
self.base_adu_size = 7 # tid(2), pid(2), length(2), uid(1)
elif isinstance(self.client.framer, ModbusRtuFramer):
Expand Down

0 comments on commit 3146d82

Please sign in to comment.