Skip to content

fix(modbus-read): chunked reads + read timeout#16

Merged
ashaffah merged 1 commit into
mainfrom
fix/modbus-read-chunk
Jun 29, 2026
Merged

fix(modbus-read): chunked reads + read timeout#16
ashaffah merged 1 commit into
mainfrom
fix/modbus-read-chunk

Conversation

@ashaffah

Copy link
Copy Markdown
Owner

Some PLCs accept the TCP connection but reject a large read request, leaving the node hung with no error (verified: qty 2 works, qty 18 hangs on the same device). Add a max_read field: quantity is read in chunks of that size on the same connection and concatenated, so the whole block comes back without exceeding the device's per-request limit (0 = one request, unchanged default). Also bound each read with a 3s timeout so an unresponsive device surfaces an io_error and reconnects instead of hanging forever.

Some PLCs accept the TCP connection but reject a large read request,
leaving the node hung with no error (verified: qty 2 works, qty 18 hangs
on the same device). Add a `max_read` field: `quantity` is read in chunks
of that size on the same connection and concatenated, so the whole block
comes back without exceeding the device's per-request limit (0 = one
request, unchanged default). Also bound each read with a 3s timeout so an
unresponsive device surfaces an io_error and reconnects instead of
hanging forever.
@ashaffah ashaffah merged commit d6dab6d into main Jun 29, 2026
1 check passed
@ashaffah ashaffah deleted the fix/modbus-read-chunk branch July 1, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant