Skip to content

Commit f67f39d

Browse files
committed
fix: use DB wildcard address 0x8A11FFFF for list_datablocks
V1-initial PLCs reject EXPLORE to object 3 (PLC_PROGRAM_RID) with V254. TIA Portal explores 0x8A11FFFF (DB_ACCESS_AREA_BASE + 0x3FFFF) instead, which returns the full program tree with DB children.
1 parent 2b78b3c commit f67f39d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

s7/_s7commplus_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ def list_datablocks(self) -> list[dict[str, Any]]:
369369
raise RuntimeError("Not connected")
370370

371371
if self._connection._session_key is not None:
372-
payload = _build_explore_payload_v3(Ids.NATIVE_THE_PLC_PROGRAM_RID)
372+
# V1-initial PLCs: explore the DB wildcard address (0x8A11FFFF)
373+
# matching TIA Portal's browse pattern
374+
payload = _build_explore_payload_v3(0x8A11FFFF)
373375
else:
374376
payload = _build_explore_request(
375377
Ids.NATIVE_THE_PLC_PROGRAM_RID, [Ids.OBJECT_VARIABLE_TYPE_NAME, Ids.BLOCK_BLOCK_NUMBER]

0 commit comments

Comments
 (0)