-
-
Notifications
You must be signed in to change notification settings - Fork 267
Comparing changes
Open a pull request
base repository: gijzelaerr/python-snap7
base: master
head repository: QuakeString/python-snap7-optimized
compare: master
- 17 commits
- 14 files changed
- 2 contributors
Commits on Mar 13, 2026
-
Optimize read_multi_vars with nodeS7-style sort/merge/packetize pipeline
Adds a 3-stage optimization (sort → merge → packetize) that collapses scattered read requests into minimal PDU-packed multi-item S7 exchanges. The optimization is transparent — read_multi_vars() uses it automatically for PE/PA/MK/DB areas, with CT/TM falling back to individual reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 93e5bdb - Browse repository at this point
Copy the full SHA 93e5bdbView commit details -
Update README with fork optimization documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for dc95adf - Browse repository at this point
Copy the full SHA dc95adfView commit details -
Add parallel dispatch, auto-tuned max_parallel, plan caching, and saf…
…e block splitting - Parallel dispatch: send multiple packets in-flight on a single TCP connection using select(), match responses by sequence number (sliding window of max_parallel). - Auto-tune max_parallel after connect() using PLC's reported MaxConnections (via SZL 0x0131), falling back to PDU-size heuristic for PLCs that don't support it (LOGO, S7-200). - Cache optimization plan (sort/merge/packetize) across read_multi_vars() calls — recomputed only when the item list changes. - Fix _split_block to never tear multi-byte items (WORD, DWORD, REAL, LREAL) across chunk boundaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 524be95 - Browse repository at this point
Copy the full SHA 524be95View commit details -
Remove MAX_VARS read limit — optimization pipeline handles any item c…
…ount The MAX_VARS=20 limit was inherited from the original snap7 C library's fixed-size array. Our pure Python pipeline sorts, merges, and packetizes any number of items into PDU-sized packets automatically. The limit is retained for write_multi_vars where no optimization exists. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 80041d6 - Browse repository at this point
Copy the full SHA 80041d6View commit details -
Rename package to python-snap7-optimized for PyPI publishing
Avoids conflict with the upstream python-snap7 package name. Updates pyproject.toml, publish workflows, and homepage URL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 7b618dd - Browse repository at this point
Copy the full SHA 7b618ddView commit details -
Rename PyPI package to snap7-optimized
python-snap7-optimized was rejected by PyPI name similarity check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for a816889 - Browse repository at this point
Copy the full SHA a816889View commit details -
Disable uv cache in publish test jobs to fix missing cache key warning
Test jobs don't checkout the repo, so there's no pyproject.toml for cache hashing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 57f6396 - Browse repository at this point
Copy the full SHA 57f6396View commit details -
Promote optimization logs to INFO level for visibility
Auto-tune, PDU negotiation, and plan-built messages are now INFO so they appear in gateway logs without requiring DEBUG on snap7 logger. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for bb1637e - Browse repository at this point
Copy the full SHA bb1637eView commit details -
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>
Configuration menu - View commit details
-
Copy full SHA for b51a496 - Browse repository at this point
Copy the full SHA b51a496View commit details
Commits on Mar 27, 2026
-
feat: add TCP keepalive and heartbeat_read() for redundant PLC support
- Enable SO_KEEPALIVE with aggressive probes (KEEPIDLE=2s, KEEPINTVL=1s, KEEPCNT=2) on all TCP connections for fast dead-peer detection (~4s) - Add Client.heartbeat_read(timeout_ms) for lightweight liveness checks reading 1 byte from M0 with independent short timeout - Update README with documentation for all optimization features: parallel dispatch, plan caching, TCP keepalive, heartbeat read, and model-specific tuning table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 0a9e8a3 - Browse repository at this point
Copy the full SHA 0a9e8a3View commit details
Commits on Mar 28, 2026
-
ci: remove GitHub Pages deploy step from doc workflow
The deploy job fails with 404 because GitHub Pages is not enabled on this fork. Keep the build job so documentation still gets validated on push, but remove the upload-pages-artifact and deploy-pages steps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for fd8848e - Browse repository at this point
Copy the full SHA fd8848eView commit details -
chore: bump version to 3.1.0 for redundant PLC support release
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for e6ab7a3 - Browse repository at this point
Copy the full SHA e6ab7a3View commit details -
fix: widen RST table columns to fix PyPI rendering validation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 13b6dff - Browse repository at this point
Copy the full SHA 13b6dffView commit details
Commits on Apr 17, 2026
-
fix(parser): correct GET_CLK byte offsets and stop masking errors
parse_get_clock_response was reading year/month/day/hour/min/sec from bytes 1-6 of the USER_DATA GET_CLK response, but S7-300/400/1200/1500 CPUs put those at bytes 2-7 (bytes 0 and 1 are reserved/version). On every real PLC the decoder therefore decoded month=26, fell into the ValueError branch, and silently returned datetime.now() — indistinguish- able from a real clock read. Two concrete problems: 1. Wrong offsets: for the observed 10-byte response 00 19 26 04 17 20 31 55 25 36 the old code read year=19, month=26 (invalid) → ValueError → fallback. The correct decoding is year=26 (2026), month=04, ..., second=55. 2. Silent fallback: both the truncated-response branch and the BCD parse-error branch returned datetime.now(). Callers had no way to distinguish "this CPU does not expose its clock" (S7-300 answering 0xd402 "Information function unavailable") from "clock read succeeded and happens to equal host time". Gateway tooling using this to detect drift would always see ~0ms, including when the PLC's real clock was hours off. Changes: - Try year offsets 2 and 1 (handles minor per-CPU variation). Accept only results whose full year lands in 1990..2099. - Reject responses whose return_code != 0xFF (explicit PLC error). - Raise ValueError with diagnostic detail instead of returning datetime.now() when the response is truncated or unparsable. Consumers now get an accurate PLC time or a clear error — no fabricated fallback values.Configuration menu - View commit details
-
Copy full SHA for 3cb4751 - Browse repository at this point
Copy the full SHA 3cb4751View commit details -
chore: bump version to 3.1.1 for clock-read bug fix
Releases the fix in 3cb4751 (parse_get_clock_response correct byte offsets and no silent datetime.now() fallback). Adds CHANGES.md entries for 3.1.0 (redundant PLC) and 3.1.1 (this fix).
Configuration menu - View commit details
-
Copy full SHA for 729b4b8 - Browse repository at this point
Copy the full SHA 729b4b8View commit details -
style: apply ruff-format to clock-parser diagnostics
Single-line the long f-string raises and switch the keepalive constants to double-quoted strings so pre-commit (ruff-format) is happy. No behavior change.
Configuration menu - View commit details
-
Copy full SHA for 5320f7d - Browse repository at this point
Copy the full SHA 5320f7dView commit details -
fix(client): narrow socket Optional before use to satisfy mypy
heartbeat() already guarded self.connection but not self.connection.socket, so the settimeout() call tripped mypy's union-attr check. Cache the socket in a local after the None check and use it for both the gettimeout() read and the settimeout() write, eliminating the need for additional guards.
Configuration menu - View commit details
-
Copy full SHA for c9c042a - Browse repository at this point
Copy the full SHA c9c042aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master