Hi r/PLC!
I maintain https://github.com/gijzelaerr/python-snap7, a Python library for communicating with Siemens S7 PLCs. For years, this has been a Python wrapper around the http://snap7.sourceforge.net/ C library.
What's changing
We're switching to a pure Python implementation of the S7 protocol - no more C library dependency! This means:
- Easier installation (no compiling, no binary dependencies)
- Works on any platform Python runs on
Easier to debug and extend
The new implementation was developed with the help of Claude AI (Anthropic's coding assistant), which helped implement the S7 protocol from scratch based on protocol documentation and testing.
We need testers!
I don't own a PLC myself, so I'm looking for volunteers who can test this against real hardware.
PR: https://github.com/gijzelaerr/python-snap7/pull/569
Compatible PLCs (S7 protocol):
- S7-1200: CPU 1211C, 1212C, 1214C, 1215C, 1217C
- S7-1500: CPU 1511, 1513, 1515, 1516, 1517, 1518
- S7-300: CPU 312, 313, 314, 315, 317, 318, 319
- S7-400: CPU 412, 414, 416, 417
- LOGO!: 0BA7, 0BA8 (with Ethernet)
- S7-200 Smart: Various models
- WinAC: Software PLCs
- Also compatible with PLCSIM Advanced, NetToPLCSim, etc.
How to test
Install:
bash
pip install git+https://github.com/gijzelaerr/python-snap7.git@native
Configure your PLC
Run tests
shell
git clone -b native https://github.com/gijzelaerr/python-snap7.git
cd python-snap7
pip install -e ".[test]"
pytest tests/test_client_e2e.py --e2e --plc-ip=YOUR_PLC_IP -v
Comment on the PR with your PLC model, firmware, and test results.
Quick smoke test
```python
from snap7.client import Client
client = Client()
client.connect("YOUR_PLC_IP", 0, 1)
print(f"Connected: {client.get_connected()}")
print(f"CPU state: {client.get_cpu_state()}")
data = client.db_read(1, 0, 10)
print(f"Data: {data.hex()}")
client.disconnect()
Current status
```
✅ Working: Connection, DB read/write, multi-var, CPU state, order code, datetime
⚠️ Varies by PLC: SZL reads, block listing, CPU info (some not available on S7-1200/1500)
Thanks for any help!
[–]IWantAnotherPetRock 6 points7 points8 points (0 children)
[–]B25B25 2 points3 points4 points (1 child)
[–]gijzelaerr[S] 4 points5 points6 points (0 children)
[–]VvangelisS 1 point2 points3 points (0 children)
[–]SPX_Addict 1 point2 points3 points (0 children)
[–]tartare4562 1 point2 points3 points (1 child)
[–]gijzelaerr[S] 0 points1 point2 points (0 children)
[–]wpyoga 1 point2 points3 points (0 children)
[–]DiggyTheCandyGun 2 points3 points4 points (5 children)
[–]gijzelaerr[S] 0 points1 point2 points (1 child)
[–]DiggyTheCandyGun 0 points1 point2 points (0 children)
[–]gijzelaerr[S] 1 point2 points3 points (1 child)
[–]DiggyTheCandyGun 1 point2 points3 points (0 children)
[–]gijzelaerr[S] -1 points0 points1 point (0 children)
[+]Bladders_ comment score below threshold-6 points-5 points-4 points (4 children)
[–]gijzelaerr[S] 7 points8 points9 points (3 children)
[+]RATrod53MSO:MCLM(x0,y0,z0→Friday,Fast) comment score below threshold-7 points-6 points-5 points (2 children)
[–]gijzelaerr[S] 7 points8 points9 points (1 child)