Skip to content

Commit fc0862c

Browse files
gijzelaerrclaude
andcommitted
Prepare 4.0 release: README, docs, changelog, s7 exports
Comprehensive cleanup for the 4.0 release: README: - 3.0 (current release) section first with snap7 examples - 4.0 (unreleased) section with s7 examples and S7CommPlus headline - Clear note that pip install gives 3.0, not 4.0 - Experimental features listed separately (optimizer, routing, symbols) - Changelog with all 4.0 features Documentation: - Update limitations.rst: V3 supported, V4 is the gap - Update plc-support.rst: S7-1500 FW 3.x+ now fully supported - Add symbols.rst doc page for SymbolTable (experimental) - Add symbols to API Reference section in index.rst s7 package: - Export SymbolTable from s7.__init__ so users can do `from s7 import SymbolTable` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b9f350e commit fc0862c

7 files changed

Lines changed: 100 additions & 36 deletions

File tree

CHANGES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
CHANGES
22
=======
33

4+
4.0.0 (unreleased)
5+
-------------------
6+
7+
Major release: new `s7` package with S7CommPlus protocol support.
8+
9+
* New `s7` package as recommended entry point with protocol auto-detection
10+
* S7CommPlus V1, V2 (TLS), and V3 support for S7-1200/1500
11+
* S7CommPlus area read/write (M, I, Q, counters, timers)
12+
* S7CommPlus PLC start/stop via INVOKE
13+
* S7CommPlus object browsing via EXPLORE
14+
* Partner BSend/BRecv with correct PBC format, async receive, PDU reference echo
15+
* TCP_NODELAY and SO_KEEPALIVE on all sockets for lower latency
16+
* Command-line interface (`snap7-cli` / `s7`)
17+
* Multi-variable read optimizer with parallel dispatch (experimental)
18+
* S7 routing for multi-subnet PLC access (experimental)
19+
* Symbolic addressing via SymbolTable (experimental)
20+
* Dependabot auto-merge for dependency updates
21+
* Documentation restructured: API Reference + Internals sections
22+
23+
### Thanks
24+
25+
* [@hs2bws-hash](https://github.com/hs2bws-hash) — extensive real PLC testing of Partner BSend/BRecv (#668)
26+
* [@QuakeString](https://github.com/QuakeString) — read optimizer inspiration via python-snap7-optimized fork
27+
428
3.0.0
529
-----
630

README.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,20 @@ Connect to any S7 PLC::
4848
No native libraries or platform-specific dependencies are required.
4949

5050

51-
Version 4.0 -- New ``s7`` Package (unreleased)
52-
===============================================
51+
Version 4.0 -- S7CommPlus & the ``s7`` Package (unreleased)
52+
============================================================
5353

5454
.. note::
5555

5656
Version 4.0 is **not yet released**. Installing with ``pip install python-snap7``
5757
gives you version 3.0, which uses the ``snap7`` package shown above.
58-
To try 4.0 early, install from the development branch (see below).
58+
To try 4.0 early, install from the development branch::
5959

60-
Version 4.0 introduces the new ``s7`` package as the standard entry point. It
61-
works with **all supported PLC models** (S7-300, S7-400, S7-1200, S7-1500),
62-
adds S7CommPlus protocol support (required for S7-1200/1500 with PUT/GET
63-
disabled), and automatically selects the best protocol::
60+
$ pip install git+https://github.com/gijzelaerr/python-snap7.git@master
61+
62+
**S7CommPlus protocol support** -- the headline feature of 4.0. S7CommPlus is
63+
required for communicating with S7-1200 and S7-1500 PLCs that have PUT/GET
64+
disabled. python-snap7 now supports S7CommPlus V1, V2 (with TLS), and V3::
6465

6566
from s7 import Client
6667

@@ -69,32 +70,31 @@ disabled), and automatically selects the best protocol::
6970
data = client.db_read(1, 0, 4)
7071
client.disconnect()
7172

72-
The ``s7.Client`` automatically tries S7CommPlus first (for S7-1200/1500) and
73-
falls back to legacy S7 when needed. The existing ``snap7`` package continues
74-
to work unchanged.
73+
The new ``s7`` package is the recommended entry point for all new projects. It
74+
automatically tries S7CommPlus first (for S7-1200/1500) and falls back to legacy
75+
S7 when needed. The existing ``snap7`` package continues to work unchanged.
7576

76-
**Help us test!** Version 4.0 needs more real-world testing before release. If
77-
you have access to any of the following PLCs, we would greatly appreciate
78-
testing and feedback:
77+
**Other new features in 4.0:**
7978

80-
* S7-1200 (any firmware version)
81-
* S7-1500 (any firmware version)
82-
* S7-1500 with TLS enabled
83-
* S7-300
84-
* S7-400
85-
* S7-1200/1500 with PUT/GET disabled (S7CommPlus-only)
86-
* LOGO! 0BA8 and newer
79+
* **Command-line interface** (``s7 read``, ``s7 write``, ``s7 info``)
80+
* **Partner BSend/BRecv** for peer-to-peer communication with S7-1500
81+
* **TCP socket optimization** (TCP_NODELAY, SO_KEEPALIVE) for lower latency
82+
* **S7CommPlus area read/write** for M, I, Q, counters, timers (not just DBs)
8783

88-
Please report your results -- whether it works or not -- on the
89-
`issue tracker <https://github.com/gijzelaerr/python-snap7/issues>`_.
84+
**Experimental features** (API may change):
9085

91-
To install the development version::
86+
* **Multi-variable read optimizer** -- merges scattered reads into minimal PDU
87+
exchanges with parallel dispatch
88+
* **S7 routing** -- connect to PLCs on remote subnets via a gateway PLC
89+
* **Symbolic addressing** -- read/write by tag name instead of raw addresses
9290

93-
$ pip install git+https://github.com/gijzelaerr/python-snap7.git@master
91+
**Help us test!** If you have access to any Siemens S7 PLC, we would greatly
92+
appreciate testing and feedback. Please report results on the
93+
`issue tracker <https://github.com/gijzelaerr/python-snap7/issues>`_.
9494

9595

96-
Version 3.0 -- Pure Python Rewrite
97-
====================================
96+
Version 3.0 -- Pure Python Rewrite (current release)
97+
=====================================================
9898

9999
Version 3.0 was a ground-up rewrite of python-snap7. The library no longer wraps
100100
the C snap7 shared library -- instead, the entire S7 protocol stack (TPKT, COTP,

doc/API/symbols.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Symbolic Addressing
2+
===================
3+
4+
.. warning::
5+
6+
Symbolic addressing is **experimental** and its API may change in future
7+
versions.
8+
9+
The :class:`~snap7.util.symbols.SymbolTable` class maps human-readable tag
10+
names to PLC addresses, enabling read/write by name instead of raw byte offsets.
11+
12+
.. code-block:: python
13+
14+
from s7 import Client, SymbolTable
15+
16+
symbols = SymbolTable.from_csv("tags.csv")
17+
client = Client()
18+
client.connect("192.168.1.10", 0, 1)
19+
20+
value = symbols.read(client, "Motor1.Speed")
21+
symbols.write(client, "Motor1.Speed", 1500.0)
22+
23+
CSV format::
24+
25+
tag_name,db_number,byte_offset,data_type
26+
Motor1.Speed,1,0,REAL
27+
Motor1.Running,1,4.0,BOOL
28+
SetPoint,1,6,INT
29+
30+
Also supports JSON::
31+
32+
symbols = SymbolTable.from_json("tags.json")
33+
34+
API reference
35+
-------------
36+
37+
.. automodule:: snap7.util.symbols
38+
:members:

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Welcome to python-snap7's documentation!
4444
API/partner
4545
API/logo
4646
API/util
47+
API/symbols
4748
API/optimizer
4849
API/type
4950

doc/limitations.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ are **not possible** with this protocol:
2424
* - Create PLC backups
2525
- Full project backup requires TIA Portal. python-snap7 can upload
2626
individual blocks, but this is not a complete backup.
27-
* - S7CommPlus V3
28-
- python-snap7 supports S7CommPlus V1 and V2 (with TLS) via the ``s7``
29-
package. V3 is not yet supported. For PLCs that only support V3, enable
30-
PUT/GET as a fallback or use OPC UA.
27+
* - S7CommPlus V4
28+
- python-snap7 supports S7CommPlus V1, V2, and V3 via the ``s7``
29+
package. V4 is not yet supported. For PLCs that require V4, use OPC UA
30+
as an alternative.

doc/plc-support.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ Supported PLCs
6565
- PUT/GET only
6666
- No
6767
- V3
68-
- **PUT/GET only**
69-
- S7CommPlus V3 uses proprietary crypto; not yet supported.
68+
- **Full**
69+
- ``s7.Client`` supports S7CommPlus V3.
7070
* - S7-1500R/H
7171
- ~2019
7272
- No
@@ -144,12 +144,11 @@ Siemens has evolved their PLC communication protocols over time:
144144
- Certificate-based
145145
- S7-1500 FW 3.x+
146146

147-
python-snap7 implements the **classic S7 protocol** and **S7CommPlus V1/V2**.
147+
python-snap7 implements the **classic S7 protocol** and **S7CommPlus V1, V2, and V3**.
148148
The ``s7`` package is the recommended entry point -- it automatically selects
149149
the best protocol for your PLC. The classic protocol remains available on most
150-
PLC families via the PUT/GET mechanism. S7CommPlus V3 is not yet supported;
151-
for PLCs that require it (such as the S7-1500R/H), consider using OPC UA as
152-
an alternative.
150+
PLC families via the PUT/GET mechanism. S7CommPlus V4 is not yet supported;
151+
for PLCs that require it, consider using OPC UA as an alternative.
153152

154153

155154
Alternatives for Unsupported PLCs

s7/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from snap7.type import Area, Block, WordLen, SrvEvent, SrvArea
2222
from snap7.util.db import Row, DB
23+
from snap7.util.symbols import SymbolTable
2324

2425
__all__ = [
2526
"Client",
@@ -35,4 +36,5 @@
3536
"SrvArea",
3637
"Row",
3738
"DB",
39+
"SymbolTable",
3840
]

0 commit comments

Comments
 (0)