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
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/Row classes in snap7/util/db.py already 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
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
SymbolicClientwrapper or mixin that resolves tag names to addresses before read/writeMotors[3].Speed)API Design Ideas
Notes
DB/Rowclasses insnap7/util/db.pyalready provide layout-based access — this feature could build on that