Skip to content

Commit

Permalink
Correct max. read size for registers. (#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Aug 22, 2024
1 parent 6a75201 commit fda815f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymodbus/pdu/register_read_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def decode(self, data):
:param data: The request to decode
"""
byte_count = int(data[0])
if byte_count < 2 or byte_count > 246 or byte_count % 2 == 1 or byte_count != len(data) - 1:
if byte_count < 2 or byte_count > 252 or byte_count % 2 == 1 or byte_count != len(data) - 1:
raise ModbusIOException(f"Invalid response {data} has byte count of {byte_count}")
self.registers = []
for i in range(1, byte_count + 1, 2):
Expand Down

0 comments on commit fda815f

Please sign in to comment.