Auto: s7-d1 — TIA Portal CSV + STEP 7 Classic AWL symbol import

Closes #299
This commit is contained in:
Joseph Doherty
2026-04-26 06:32:18 -04:00
parent ac3fd45cc6
commit a908dff7b5
20 changed files with 2526 additions and 0 deletions

View File

@@ -940,6 +940,32 @@ project that rejects PG and accepts OP). That test is documented in
`tests/ZB.MOM.WW.OtOpcUa.Driver.S7.IntegrationTests` but only runs against
real firmware — the pymodbus-style "TSAP simulator" doesn't exist for S7.
## Symbol import
PR-S7-D1 / [#299](https://github.com/dohertj2/lmxopcua/issues/299) — bulk-import
TIA Portal "Show all tags" CSV exports and STEP 7 Classic AWL declaration files
into the S7 driver's tag list. Operators no longer hand-edit the
`Drivers/<instance>/Config/Tags` JSON for hundred-tag projects.
Two formats supported v1:
- **TIA Portal CSV** — `Name,Path,Data type,Logical address,Comment,Hmi accessible,…`.
en-US (`,`) and DE-locale (`;` separator + `,` decimal) auto-detected.
HMI-hidden symbols filter out automatically; UDT-typed rows import as
placeholders until PR-S7-D2 ships proper UDT layout.
- **STEP 7 Classic AWL** — `VAR_GLOBAL` + `DATA_BLOCK` declarations parsed
best-effort with position-based offset assignment.
Two surface options:
- **CLI**: `otopcua-s7-cli import-symbols --file foo.csv --format tia` emits
an `appsettings.json` JSON fragment for hand-merge.
- **API**: `S7DriverOptions.AddTiaCsvImport(path, out result)` /
`AddAwlImport(path, out result)` for server-side bootstrap paths.
Full reference: [`docs/drivers/S7-TIA-Import.md`](../drivers/S7-TIA-Import.md).
CLI flag table: [`docs/Driver.S7.Cli.md` "import-symbols"](../Driver.S7.Cli.md#import-symbols).
## References
1. Siemens Industry Online Support, *Modbus/TCP Communication between SIMATIC S7-1500 / S7-1200 and Modbus/TCP Controllers with Instructions `MB_CLIENT` and `MB_SERVER`*, Entry ID 102020340, V6 (Feb 2021). https://cache.industry.siemens.com/dl/files/340/102020340/att_118119/v6/net_modbus_tcp_s7-1500_s7-1200_en.pdf