exchange-formats
Skill0 starsChanged 37 days agoMITView on GitHub
Read, write, convert and validate vendor-neutral PLC and engineering exchange files. Covers PLCopen XML (TC6 v2.0 tc6_0200 and v2.01 tc6_0201: project/fileHeader/ contentHeader/types/pous/instances, interface variables, ST/IL bodies in XHTML, LD/FBD/SFC graphs with localId/connection/refLocalId, and vendor addData), IEC 61131-10:2019 (which is a different schema, not v2.01 renamed), AutomationML IEC 62714 and CAEX IEC 62424 (InstanceHierarchy, PLCopenXMLInterface refURI links, logic via Part 4), and DEXPI P&ID data (Proteus 1.x PlantModel, DEXPI 2.0, ISO 15926) for deriving I/O lists and control modules. Use when a file is .xml/.aml/.amlx from PLCopen, CODESYS, TwinCAT, Machine Expert, AutomationML or DEXPI, or when moving logic between PLC tools.
In this repository12 other files it gives its agents.
- convertSkill
- debugSkill
- developSkill
- iec-61131-3Skill
- iec-61499Skill
- new-pouSkill
- other-platformsSkill
- packml-isa88-opcuaSkill
- reviewSkill
- schneiderSkill
- siemensSkill
- validateSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Start from assets/plcopen-st-pou.xml.
- Very specific: line 43
Every connection/@refLocalId points to an existing localId in the same body.
- Distinctive: line 64
When reading such a file, look inside those vendor blocks.
- Distinctive: line 66
When writing for a non-CODESYS consumer, put the POUs in the standard elements.
- Distinctive: line 69
TwinCAT to TwinCAT: use the ZIP export, not PLCopenXML.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Exchange formats: PLCopen XML, IEC 61131-10, AutomationML, DEXPI
First, identify the format by root element and namespace
| Root + namespace | Format | Checked by |
<project xmlns="http://www.plcopen.org/xml/tc6_0201"> | PLCopen XML v2.01 (2009) | plc_validate.py, rules PX0xx |
<project xmlns="http://www.plcopen.org/xml/tc6_0200"> | PLCopen XML v2.0 (2008), which CODESYS, TwinCAT and Machine Expert still write | PX0xx |
<Project xmlns="www.iec.ch/public/TC65SC65BWG7TF10"> | IEC 61131-10:2019, with PascalCase elements. Not compatible with v2.01 | PX1xx (light) |
<CAEXFile xmlns="http://www.dke.de/CAEX" SchemaVersion="3.0"> | AutomationML Ed.2 / CAEX 3.0 | AM0xx |
<CAEXFile SchemaVersion="2.15">, no namespace | AutomationML Ed.1 / CAEX 2.15 | AM0xx |
<PlantModel> + <PlantInformation SchemaVersion="4.1"> | DEXPI 1.3 (Proteus 4.1); 1.4 uses Proteus 4.2.0 | DX0xx |
<Model> | DEXPI 2.0 "DEXPI XML" (2025-10-10), a generic object model | DX0xx with --format dexpi |
Non-negotiables when you generate PLCopen XML
Required skeleton:
fileHeaderwithcompanyName,productName,productVersionandcreationDateTime.contentHeaderwithnameand all threecoordinateInfo/{fbd,ld,sfc}/scaling.types/dataTypesandtypes/pous, which may be empty.instances/configurations, which may be empty.
Start from assets/plcopen-st-pou.xml.
- ST and IL go in the XHTML namespace: either
<ST><xhtml:p><![CDATA[…]]></xhtml:p></ST>as Beremiz writes it, or<ST><xhtml xmlns="http://www.w3.org/1999/xhtml">…</xhtml></ST>as CODESYS writes it. Read both. Write CDATA. Graphical bodies:
localIdis unique per body.- Every
connection/@refLocalIdpoints to an existinglocalIdin the same body. formalParameternames the producer's output pin. When it is omitted on a block, the first output that is not ENO is used.
See assets/plcopen-ld-rung.xml.
- Match the namespace to the importer. CODESYS-family tools export
tc6_0200. The v2.0 → v2.01 changes are minor, but a strict importer can reject the other namespace. - Never trust XSD validation alone. A duplicate
localId, a danglingrefLocalId, an unknownderivedtype and broken ST all pass the XSD. Always runpython3 ${CLAUDE_PLUGIN_ROOT}/scripts/plc_validate.py file.xml. - Task intervals come in two incompatible spellings. Beremiz writes
T#100ms, while TwinCAT and CODESYS write ISOPT0.1S, and TwinCAT rejectst#10ms. Ask which tool will import the file.
CODESYS / TwinCAT / Machine Expert exports hide the project in addData
A CODESYS-family export can have an empty standard <pous/>, with every POU inside
<addData><data name="http://www.3s-software.com/plcopenxml/pou">. The standard task
interval can read PT0S while the real cycle sits in …/plcopenxml/tasksettings.
Validator rules PX050 and PX051 flag both cases.
- When reading such a file, look inside those vendor blocks. Methods, properties, folders and object IDs live there too.
- When writing for a non-CODESYS consumer, put the POUs in the standard elements.
- Known loss: a GVL cannot hold both
VAR_GLOBALandVAR_GLOBAL CONSTANTthrough PLCopenXML, so the constants come back as plain globals. - TwinCAT to TwinCAT: use the ZIP export, not PLCopenXML.
Both templates in assets/ validate against the official tc6_xml_v201.xsd, and they are
re-checked by the plugin's test suite.
Schemas and licences
Neither XSD may be bundled with this plugin:
- The TC6 v2.01 document says "All rights reserved".
- The IEC 61131-10 schema is an IEC Code Component under the CCv1 licence.
Download them from https://www.plcopen.org/downloads/ ("XML Exchange": the TC6 v2.01 zip,
and "Code Components of IEC 61131-10"). Then run
plc_validate.py file.xml --xsd tc6_xml_v201.xsd, which uses xmllint or lxml.
References
- references/plcopen-xml.md: the full element model (interface sections, the graphical element table, SFC elements and qualifiers, instances, addData) and the IEC 61131-10 differences.
- references/automationml.md: IEC 62714 parts and editions, CAEX 2.15 vs 3.0, how logic is linked, AR APC, tools.
- references/dexpi.md: DEXPI versions, the Proteus structure, the instrumentation classes, ISO 15926 parts, and a method to derive an I/O list.
Converting logic between tools
Load the convert skill. In short:
- Graphical logic is portable only as PLCopen LD/FBD (with the CODESYS subset caveat), SIMATIC SD rungs or Rockwell neutral text.
- Never hand-write TwinCAT
XmlArchivegraphs or Control Expert.XBD/.XLDfiles. - Siemens TIA has no PLCopen XML import for logic: it uses SimaticML or SIMATIC SD
(see the
siemensskill). This rests on a secondary source, so confirm it against the user's TIA version.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

