diff --git a/pymodbus/pdu/register_read_message.py b/pymodbus/pdu/register_read_message.py index ee1fd0e1a..c647c2ef0 100644 --- a/pymodbus/pdu/register_read_message.py +++ b/pymodbus/pdu/register_read_message.py @@ -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):