diff --git a/pymodbus/pdu/file_message.py b/pymodbus/pdu/file_message.py index c4e3f7429..ea72c2afa 100644 --- a/pymodbus/pdu/file_message.py +++ b/pymodbus/pdu/file_message.py @@ -295,7 +295,7 @@ def calculateRtuFrameSize(cls, data: bytes) -> int: """Calculate the size of the message.""" hi_byte = int(data[2]) lo_byte = int(data[3]) - return ((hi_byte << 16) + lo_byte) + 4 + return ((hi_byte << 8) + lo_byte) + 4 def __init__( self, values: list[int] | None = None, dev_id: int = 1, transaction_id: int = 0