Skip to content

Commit b51a496

Browse files
QuakeStringclaude
andcommitted
Fix S7-300 connection reset: set max_parallel=1 for PDU 240
S7-300 PLCs reset the TCP connection when multiple PDUs are sent back-to-back (parallel dispatch). Force sequential mode for small PDU PLCs to prevent connection reset by peer errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bb1637e commit b51a496

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snap7/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def _send_receive_parallel(
219219
# Smaller PDUs indicate older/smaller PLCs with fewer resources.
220220
_PDU_PARALLEL_MAP = [
221221
(960, 8), # S7-1500, S7-1200 high — full parallelism
222-
(480, 6), # S7-400, S7-1200 default
223-
(240, 2), # S7-300, LOGO, S7-200 — conservative
222+
(480, 4), # S7-400, S7-1200 default
223+
(240, 1), # S7-300, LOGO, S7-200 — sequential only (resets on parallel)
224224
]
225225

226226
def _auto_tune_parallel(self) -> None:

0 commit comments

Comments
 (0)