Add extended S7CommPlus operations: browse, list DBs, TIA XML import#687
Merged
Conversation
Implements features from issues #681, #682, #685, #686: S7CommPlus EXPLORE-based operations (experimental): - list_datablocks(): enumerate all DBs via EXPLORE, with legacy fallback to list_blocks_of_type (#686) - browse(): walk PLC symbol table via EXPLORE to get variable names, DB numbers, and offsets — returns data for SymbolTable (#681) - Structured EXPLORE request builder with attribute filters - Response parsers for datablock info and field layout SymbolTable enhancements (experimental): - from_tia_xml(): parse TIA Portal DB source XML exports (#682) - from_browse(): create SymbolTable from live PLC browse results (#681) Protocol IDs added for EXPLORE, subscriptions, alarms: - NATIVE_THE_PLC_PROGRAM_RID, OBJECT_VARIABLE_TYPE_NAME, BLOCK_BLOCK_NUMBER, CLASS_SUBSCRIPTION, alarm subscription IDs s7.Client unified methods: - list_datablocks() with S7CommPlus/legacy fallback - browse() for live symbol resolution - explore(explore_id) with specific object browsing PLC clock (#685) already works via __getattr__ delegation to snap7.Client.get_plc_datetime/set_plc_datetime. Alarm subscriptions (#683) and data change subscriptions (#684) have protocol IDs defined but full implementation requires real PLC testing of the subscription CREATE_OBJECT flow. All features marked experimental in docstrings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements features from #681, #682, #685, #686. All marked experimental.
S7CommPlus EXPLORE-based operations:
list_datablocks()— enumerate all DBs via EXPLORE, with legacy fallback (List datablocks from PLC via S7CommPlus #686)browse()— walk PLC symbol table to get variable names, DB numbers, offsets (Live symbol browsing: resolve tag names directly from PLC #681)SymbolTable enhancements:
from_tia_xml()— parse TIA Portal DB source XML exports (TIA Portal XML import for SymbolTable #682)from_browse()— create SymbolTable from live PLC browse results (Live symbol browsing: resolve tag names directly from PLC #681)Example workflow:
PLC clock (#685): Already works via
__getattr__delegation —s7.Clientdelegatesget_plc_datetime()/set_plc_datetime()tosnap7.Clientautomatically.Alarm/data subscriptions (#683, #684): Protocol IDs defined for subscriptions and alarms. Full implementation needs real PLC testing of the subscription CREATE_OBJECT flow — tracked in the issues.
Test plan
list_datablocks()against real PLCbrowse()against real PLCfrom_tia_xml()with real TIA Portal exportCloses #681, closes #682, closes #685, closes #686.
🤖 Generated with Claude Code