diag_query_data might not be working as expected for msg-parameter length of one or two bytes #2451
MatthiasJaeger
started this conversation in
General
Replies: 3 comments 8 replies
|
Thanks I will try to simulate your device responses. 32 bytes is a magical limit for a number of rs485 usb devices, so it's normal the message will be received in chunks, however pymodbus should assemble the, and present a complete response.....it not, then please make a short debug log so I have something to simulate. |
3 replies
|
Please look at the the modbus standard, "return query data" have a data field of minimum 2 bytes and it must be a multiple of 2. So sending 0, 1 or 3 bytes are not allowed. |
5 replies
|
if you want a check on the input data, then pull requests are welcome. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When testing the diagnostics function on a serial connection to a hardware device I find that for most messages of two bytes or longer it works as expected. For single byte or zero byte messages an error is generated instead. It looks like the replies are discarded because they are considered to be to short.
This is using the dev branch (couple of days old pull) of pymodbus.
Test code:
Debug messages:
Side note: For long test messages (~> 32 bytes) the reply sometimes gets truncated. Still investigating if that happens in my hardware or in pymodbus.
All reactions