-
-
Notifications
You must be signed in to change notification settings - Fork 261
Open
Description
Summary
Add support for reading and writing PLC data by symbolic tag names instead of raw DB number + byte offset.
Background
In TIA Portal projects, engineers define symbolic names for variables (e.g., Motor1.Speed, Tank.Level). Currently, users must manually map these names to raw addresses (DB1.DBD4, etc.), which is error-prone and breaks when the PLC program is reorganized.
What needs to be done
- Define a tag/symbol table format (or support multiple formats)
- Implement a parser for TIA Portal export files (.xml symbol table exports)
- Implement a parser for CSV/JSON symbol table formats (for manual definitions)
- Create a
SymbolicClientwrapper or mixin that resolves tag names to addresses before read/write - Handle nested UDT (User-Defined Type) structures
- Support array indexing in symbolic paths (e.g.,
Motors[3].Speed) - Cache resolved addresses for performance
- Add tests with sample symbol tables
- Add documentation and examples
API Design Ideas
from snap7 import Client, SymbolTable
# Load symbols from TIA Portal export
symbols = SymbolTable.from_tia_xml("project_tags.xml")
client = Client()
client.connect("192.168.1.10", 0, 1)
# Read by tag name
speed = symbols.read(client, "Motor1.Speed") # returns float
level = symbols.read(client, "Tank.Level")
# Write by tag name
symbols.write(client, "Motor1.Speed", 1500.0)Notes
- TIA Portal can export symbol tables as XML or in AWL format
- The existing
DB/Rowclasses insnap7/util/db.pyalready provide layout-based access — this feature could build on that - Consider supporting L5X (Rockwell) format too for broader appeal, but Siemens formats are the priority
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels