Skip to content

Commit 69cfefe

Browse files
Treat exception codes as valid responses (#662)
1 parent 52037bf commit 69cfefe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymodbus/transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _validate_response(self, request, response, exp_resp_len):
123123
return False
124124

125125
mbap = self.client.framer.decode_data(response)
126-
if mbap.get('unit') != request.unit_id or mbap.get('fcode') != request.function_code:
126+
if mbap.get('unit') != request.unit_id or mbap.get('fcode') & 0x7F != request.function_code:
127127
return False
128128

129129
if 'length' in mbap and exp_resp_len:

0 commit comments

Comments
 (0)