You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
New features
Add snap7.tags.decode_tag and snap7.tags.encode_tag, which convert between a tag's raw bytes and a Python
value, for applications that batch their own raw reads and writes. The private names in snap7.client still
work (#973).
Bug fixes
set_wchar now raises ValueError for a character above U+FFFF, as set_wstring does. Previously it grew the
buffer by two bytes, shifting every later field (#968).
Clock data with a milliseconds digit above 9 is now rejected, by the client when reading the clock and by the server
when setting it. Previously 12 a3 decoded to .130 (#966).
parse_tag now raises ValueError under strict=True, the default, for a type with no known size, such as DB1.DBB0:STRING without a length. Previously this failed only when .size was read. S5TIME now has a size
and can be read, but not yet written (#974).
read_szl and list_blocks_of_type now check the PDU reference of follow-up replies, in both clients. Previously a
stale fragment was added to the result (#967).
disconnect() now addresses its COTP disconnect request to the PLC's connection reference, in both clients.
Previously it used the client's own reference. That is the likely reason a CP 343-1 kept each connection
allocated until it was restarted (#972, not yet confirmed on the CP). The passive Partner now echoes the active
partner's reference in its connection confirm (#979).
All snap7.util setters now raise ValueError when the value doesn't fit in the buffer. Most of them silently grew
a short bytearray, which changed the length written to the PLC or shifted later fields, and set_lreal, set_string, set_bool and the other single-byte setters raised struct.error or IndexError (#975).