Closed tomkcook closed 7 years ago
I'm working on a fix, BTW, so when I get it working I'll submit a pull request. Setting the header_size
to 3 fixes my immediate issue, but there are further problems decoding the response that I haven't had a chance to look into yet.
Merged your pull-request: https://github.com/uzumaxy/pymodbus3/pull/5 Thanks!
In
transaction.py
, at line 494,header_size
is set to 0x01. This length is used inModbusTransactionManager.handle_message_framing
as the number of bytes that have to be read before the header can be decoded. For the 'Read holding registers' message, the result of this is that the call topdu_class.calculate_rtu_frame_size
fails because not enough data has been read to calculate how big the frame is. Then when line 112 oftransaction.py
is reached, not enough of the frame is read to decode it all.I'm not sure if there's any particular downside to changing line 494 to set
header_size
to 3? Are there any messages shorter than that?