-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Versions
- Python: 3.10.0
- OS: Win 10
- Pymodbus: 3.0.0.dev3 (also 2.5.3)
- Modbus Hardware (if used): Custom
Pymodbus Specific
- Client: rtu - sync/async
Description
The mask_write_register command processes partial responses resulting in error:
Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
The issue is traced back to the class MaskWriteRegisterResponse which does not include the get_response_pdu_size method. As a result, the client does not wait for the full response and only the initial data in the receive buffer is processed. A race condition results with unpredictable failures.
Adding the following method to the class resolves the problem.
Code and Logs
def get_response_pdu_size(self):
"""
Func_code (1 byte) + Starting Address (2 byte) + And_mask (2 Bytes) + OrMask (2 Bytes)
:return:
"""
return 1 + 2 + 2 + 2Metadata
Metadata
Assignees
Labels
No labels