Bug fix release for PLC clock reads.
- Fix:
get_plc_datetime()/parse_get_clock_response()now reads the year from byte offset 2 of the USER_DATA GET_CLK response (previously byte 1, which is a reserved / version marker on S7-300, S7-400, S7-1200 and S7-1500 CPUs). The old offset decoded garbage month values on every real PLC, which then fell through to a silent fallback. - Fix: Remove the silent
datetime.now()fallback from the clock parser. When the response is truncated, the PLC replies with an error code (e.g. 0xd402 "Information function unavailable"), or BCD decoding fails, the parser now raisesValueErrorwith diagnostic detail. Callers that previously trusted the returned datetime could not distinguish a real clock read from fabricated host time. - The parser probes year offsets 2 and 1 and accepts the first that yields a plausible year in 1990..2099, so firmware variants that omit the version-marker byte still work.
- Feature: redundant PLC support for S7-300H/400H/1500R/H (automatic failover between primary and standby CPUs with heartbeat monitoring).
- Parallel dispatch for multi-PLC polling.
Major release: python-snap7 is now a pure Python S7 communication library.
- Breaking: The C snap7 library is no longer required or used
- Complete rewrite of the S7 protocol stack in pure Python
- Native Python implementation of TPKT (RFC 1006) and COTP (ISO 8073) layers
- Native S7 protocol PDU encoding/decoding
- Pure Python server implementation for testing and simulation
- No platform-specific binary dependencies
- Improved error handling and connection management
- Full type annotations with mypy strict mode
- CLI interface for running an S7 server emulator (
pip install "python-snap7[cli]")
If you experience issues with 3.0, pin to the last pre-3.0 release:
$ pip install "python-snap7<3"
- fix wheel tag for linux x86_64 by @nikteliy in gijzelaerr#297
- Fixed typo area doesn't exist areas does by @Ofloo in gijzelaerr#306
- add get_time and set_time in util by @Yingliangzhe in gijzelaerr#308
- modification of TIME data type by @Yingliangzhe in gijzelaerr#311
- added DATE_AND_TIME Value as Datetime object by @zsisamci in gijzelaerr#312
- #273 by @nikteliy in gijzelaerr#321
- Add byte type parsing to DB_Row API + set parsing case insensitive by @LoicGRENON in gijzelaerr#315
- added missing types in WordLen by @zsisamci in gijzelaerr#326
- Add support for read/write unsigned value from bytearray by @LoicGRENON in gijzelaerr#316
- fixing ip string paramters to c function by @zsisamci in gijzelaerr#329
- Add py.typed marker file by @mthuurne in gijzelaerr#342
- require correct package name, fixes issue #344 by @gijzelaerr in gijzelaerr#345
- Fix warnings by @nikteliy in gijzelaerr#350
- Update license identifier by @Shortfinga in gijzelaerr#349
- Update client db_write docs by @pwablito in gijzelaerr#352
- Fix db_offset calculation error by @lubbbert in gijzelaerr#351
- fix #355 by @swamper123 in gijzelaerr#359
- fix #272 by @swamper123 in gijzelaerr#360
- fix get_time for small values by @swamper123 in gijzelaerr#358
- add more getter methods for utils by @swamper123 in gijzelaerr#357
- Prepare for 1.2 by @gijzelaerr in gijzelaerr#364
- @Ofloo made their first contribution in gijzelaerr#306
- @zsisamci made their first contribution in gijzelaerr#312
- @LoicGRENON made their first contribution in gijzelaerr#315
- @mthuurne made their first contribution in gijzelaerr#342
- @Shortfinga made their first contribution in gijzelaerr#349
- @pwablito made their first contribution in gijzelaerr#352
- @lubbbert made their first contribution in gijzelaerr#351
Full Changelog: https://github.com/gijzelaerr/python-snap7/compare/1.1...1.2
- Make a binary wheel for all platforms (#232)
- Improve doc strings of all functions (#242)
Special thanks for this release to
- Fabian Beitler
- Nikteliy
- Lautaro Nahuel Dapino
- Drop python 2 support (#214)
- Feature request: ReadSZL() (#196)
- Keep argument format across the functions (#193)
- Drop Python2 Tests (#167)
- Support for S5TIME (#163)
- Add type annotations (#157)
- client.full_upload() return bytearray size 65536 (#127)
- Some client tests segfault on Linux (#26)
- Not all functions are implemented yet (#25)
special thanks to Fabian Beitler and Nikteliy for their contributions to the 1.0 release!
- Update read_multi.py (#132)
- Added fixes to snap7/client.py read_area function to allow for Counter and Timer Reads (#121)
- Post to a public docker repository? (#119)
- Implementation of Cli_SetDateTime, Cli_GetDateTime enhancement (#114)
- Fix OSX travis build #99
- util.get_int() broken #101
- Compatibility issue with Python3 #109
- Logo 8 improvements bug #105
- util.get_int() broken (#65, #71)
- fix Add files via upload bug (#59)
Special thanks to Pelle van der Heide for solving issues
- Add del to client, server and partner (#69)
- Add files via upload (#59)
Special thanks to xybsoft for solving issues
- adding some missing functions
- fixing Python3 support (issue #43)
- improving the documentation
More functions added:
- client.plc_stop
- client.plc_cold_start
- client.plc_hot_start
- client.read_multi_vars
Small fix, README.rst was not included in sdist
- Add support for Windows
- Add functions added in Snap7 1.1.0
- Add missing client functions
- fix some partner functions
- simplified API
- Initial release.