State: TwinCAT kit shipped. Minimal-diff edits are tested on the real fixture files, Linux only. No edited file has yet been opened or built in TwinCAT XAE; the round-trip kit waits for its report. CODESYS and TIA Portal objects are not edited.
Commands
Right-click a row in TwinCAT Projects, or use the Command Palette (category Neural Inverse PLC):
| Command | What it changes |
|---|---|
| Add POU | A new PROGRAM, FUNCTION_BLOCK or FUNCTION (a function asks for its return type) |
| Add GVL, Add DUT | A new global variable list or data unit type |
| Add Method, Add Property, Add Action | A member of a POU; methods and properties also on an interface. A property is Get only, or Get and Set. Only the object file changes |
| Rename Object | The name, declaration header, LineIds, file name, project entry and program calls in task objects. The GUID stays |
| Move Object to Folder | Moves the object to another folder of the PLC project |
| Remove Object | Removes the project entry first, then deletes the file |
| Add Library Reference, Remove Library Reference | See Libraries |
Add an object
- Right-click the PLC project or one of its folders and pick Add POU, Add GVL or Add DUT.
- Give the name (and for a POU its kind; for a function its return type).
- Read the confirmation: it names the files written. Click Change Files.
Without a folder, the object goes where XAE files its kind. The new file follows the project's own conventions, read from its sibling files: line breaks, byte order mark and final line break. It gets a fresh GUID. Members are inserted in name order in the form the real files use, and property accessors get their own GUIDs.
Rename an object
Rename Object renames everywhere the project itself stores the name. The confirmation also lists the other files that still mention the old name and says they are not changed: references in other objects' code are listed, not rewritten.
The confirmation and the write checks
Every edit asks with Change Files, naming the files written and deleted. The edit is refused, and nothing is written, when:
- a file changed on disk since the project was read;
- the name is taken, also in another case;
- a file appears between the check and the write;
- a symbolic link is involved;
- a name is an IEC keyword or a Windows device name, a folder leaves the project, or a function has no type.
The edit writes exactly its files and the project is read again.
Why the diffs stay small
A declaration or body change writes only the lines that differ, in the file's own line breaks, and keeps the GUIDs of the object and its members. Renaming every object file of the test fixtures to another name and back restores each byte for byte; adding and then removing an object restores the .plcproj byte for byte. Teammates still in XAE see only the change that was asked for. See Review changes.
Edit declarations and bodies
Declarations and Structured Text bodies are edited as text in the object file's XML, with the Structured Text checks, or in the Declaration table. Graphical bodies are edited in the diagram editor.
Check that XAE still opens your files
Whether a project edited here still opens and builds in TwinCAT XAE without a change XAE has to make has not been checked. Until the round-trip kit reports, open and build edited projects in XAE yourself before relying on them.
Not verified
- XAE opening, building or activating any edited file.
- Set-only properties; graphical bodies are kept as XML and never overwritten by these commands.
- Windows; customer projects.