Skip to content

Commit 285e20a

Browse files
gijzelaerrclaude
andauthored
doc: add I/Q/M symbolic access caveats to API docstrings (#739) (#744)
Document hardware-observed limitations from S7-1200 FW V4.5 testing: physical PAQ error at zero, TCP RST per I/Q/M connection, and stale symbolic BOOL LIDs vs. physical PAQ byte. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a871932 commit 285e20a

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

s7/_s7commplus_client.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ def read_symbolic(self, access_area: int, lids: list[int], symbol_crc: int = 0)
211211
between downloads. Symbolic access navigates the PLC's symbol tree
212212
using LIDs (Local IDs) discovered via :meth:`browse`.
213213
214+
.. note:: **I/Q/M area caveats** (observed on S7-1200 FW V4.5):
215+
216+
- **Physical PAQ LIDs return error when value is 0x00.**
217+
Reading a physical Q-byte LID (e.g. QB0) when all outputs are
218+
OFF raises ``RuntimeError`` instead of returning ``b"\\x00"``.
219+
Callers should catch the exception and treat it as zero.
220+
- **TCP RST after first I/Q/M read.** The PLC sends a TCP RST
221+
after the first successful I/Q/M ``GetMultiVariables`` per
222+
connection. DB reads are unaffected. Workaround: reconnect
223+
before each I/Q/M read.
224+
- **Symbolic BOOL LIDs can be stale vs. physical PAQ.** A
225+
symbolic BOOL tag written via ``SetMultiVariables`` may not
226+
reflect later forced writes to the physical address. For
227+
reliable output state, read the physical byte LID instead.
228+
214229
Args:
215230
access_area: Access area ID. For DBs this is
216231
``0x8A0E0000 + db_number``.
@@ -235,7 +250,13 @@ def write_symbolic(self, access_area: int, lids: list[int], data: bytes, symbol_
235250
236251
.. warning:: This method is **experimental** and may change.
237252
238-
See :meth:`read_symbolic` for context on when to use symbolic access.
253+
See :meth:`read_symbolic` for context on when to use symbolic access
254+
and I/Q/M area caveats.
255+
256+
.. note:: Writing a symbolic BOOL tag does **not** update the
257+
physical PAQ byte on some S7-1200 firmware versions. A
258+
subsequent read of the physical byte LID may show a different
259+
value than the symbolic BOOL LID.
239260
240261
Args:
241262
access_area: Access area ID.

s7/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ def read_tag(self, tag: Any) -> Any:
310310
S7CommPlus LID-based access. For classic tags (byte-offset),
311311
delegates to the legacy client.
312312
313+
.. note:: When reading symbolic I/Q/M tags on S7-1200 PLCs, see
314+
:meth:`~s7._s7commplus_client.S7CommPlusClient.read_symbolic`
315+
for known caveats (PAQ error at zero, TCP RST per connection,
316+
stale BOOL LIDs).
317+
313318
Args:
314319
tag: A :class:`~snap7.tags.Tag` instance or address string.
315320

0 commit comments

Comments
 (0)