Skip to content

Add Siemens TIA Portal SimaticML support - #4

Merged
DanShinde merged 1 commit into
mainfrom
feat/simaticml
Nov 25, 2026
Merged

DanShinde merged 1 commit into
mainfrom
feat/simaticml

Conversation

@DanShinde

Copy link
Copy Markdown
Owner

What

plcdiff now reads Siemens TIA Portal SimaticML exports (one block, data type or tag table per file, as Openness or an export add-in writes them):

  • Blocks (OB, FB, FC, global/instance DB): block attributes, the interface with member comments and start values, and the networks.
  • LAD / FBD networks are decoded from their wiring into one statement per coil, box or call, e.g. #Run := (#Start OR #Run) AND NOT #Stop or TON<Time> #JamTimer(IN := #Run, PT := T#2S, Q => #JamAlarm).
  • SCL networks are compared line by line, indentation kept; line comments go to the note so a comment-only edit shows as such.
  • PLC data types (nested members) and PLC tag tables (tags with address, user constants).
  • Export noise is ignored: <Engineering version>, <DocumentInfo>, ID/UId numbering, compile/modified dates and similar read-only status nodes. Re-exporting the same block from V19 and V20 gives no diff. The block number stays a change.

Also fixes the summary line's plural for nouns ending in "y" (2 properties changed).

Example

$ plcdiff diff examples/FB_Conveyor_v1.xml examples/FB_Conveyor_v2.xml
FB FB_Conveyor / Networks
  ~ Line 2
      - #Run := (#Start OR #Run) AND NOT #Stop
      + #Run := (#Start OR #Run) AND NOT #Stop AND NOT #Jam
  ~ Line 4
      - TON<Time> #JamTimer(IN := #Run, PT := T#2S, Q => #JamAlarm)
      + TON<Time> #JamTimer(IN := #Run, PT := T#3S, Q => #JamAlarm)

Verified

  • uv run pytest: 48 passed (8 new in tests/test_simaticml.py)
  • ruff check, ruff format --check, mypy: clean
  • README format table, known limits and CHANGELOG updated

Generated by Claude Code

Parse SimaticML block, data type and tag table exports into the
normalized document: block attributes, interface members with comments
and start values, LAD/FBD networks decoded to one statement per output,
and SCL line by line. Export noise (TIA version, timestamps, ID/UId
numbering, compile dates) is left out so re-exports compare equal.

Also pluralize summary nouns ending in y.
@DanShinde
DanShinde merged commit 416a8f7 into main Nov 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant