Skip to content

3.1.0

Latest

Choose a tag to compare

@gijzelaerr gijzelaerr released this 17 Jul 12:07

python-snap7 3.1.0

A feature-rich release adding async support, a CLI, symbolic addressing, network discovery, and many quality-of-life improvements to the pure-Python S7 library introduced in 3.0.

New features

  • AsyncClient — full asyncio-based client for non-blocking PLC communication (#593)
  • CLI toolssnap7 command-line interface for PLC interaction; install with pip install "python-snap7[cli]" (#631)
  • Typed DB access — convenience methods for reading/writing common S7 data types (BOOL, INT, REAL, etc.) directly (#632)
  • PROFINET DCP discovery — discover PLCs on the local network without knowing their IP addresses (#634)
  • Heartbeat & auto-reconnect — connection monitoring with configurable heartbeat interval and exponential-backoff reconnection (#635)
  • Symbolic addressing (Tags) — read/write PLC variables by name using a unified Tag API with PLC4X and nodeS7 dialect support (#638, #697, #701)
  • S7 routing — access PLCs behind gateways across multiple subnets (#639)
  • Multi-variable read optimizer — automatically batch multiple reads into minimal PDU exchanges (#641)
  • Structured logging — PLC connection context (host/rack/slot) attached to log records, with JSON formatter (#688)
  • Diagnostic buffer & data-change subscriptions — read the PLC diagnostic buffer and subscribe to variable changes (#690)
  • Block transfer & CPU state control — upload/download blocks, start/stop/hot-start/cold-start the PLC (#693)
  • Demo subcommandsnap7 demo starts a live server exposing real host metrics for quick testing (#704)

Bug fixes

  • Fix get_cpu_info and S7SZL.__str__ (#692)
  • Fix server SZL 0x001C response to match real PLC format (#694)
  • Fix AttributeError from __del__ during interpreter shutdown (#707)
  • Use connection_type in TSAP composition during connect (#766)
  • Accept memoryview in setter/getter type annotations (#647)
  • Zero-pad milliseconds in get_time so 3 ms reads as ".003" (#716)
  • Use proper PI service PDU format for PLC control commands (#733, #743)
  • Set TCP_NODELAY and SO_KEEPALIVE on all S7 sockets (#677)
  • Backport robustness improvements from python-s7comm (#580)
  • Add get_ulint and get_lint to snap7.util exports (#652)
  • Fix async get_cpu_info and extract shared SZL/block parsers (#702)
  • Fix demo primary-IP guess with VPN/tunnel interfaces (#708)

Other improvements

  • Property-based testing with Hypothesis (#636)
  • Improved documentation with intersphinx cross-references and restructured API docs
  • Full type annotations with mypy strict mode (no type: ignore needed)
  • Python 3.10–3.14 support

Upgrading from 3.0

This is a backwards-compatible release. All existing 3.0 code should work without changes. New features are additive.

If you experience any issues, please report them on the issue tracker.