plc_project
Create, open, import, and export PLC projects; configure boot flags; control online runtime; and save as libraries via TwinCAT Automation Interface.
Instructions
PLC (IEC) project lifecycle on the open solution. Tree paths use ^ separators; the PLC ROOT node is TIPC^, the nested project INSTANCE node is TIPC^^ Project. NODE MATTERS: ITcPlcProject (boot flags / generate_boot) is on the ROOT; ITcPlcIECProject* (plcopen_export/import / save_as_library) is on the INSTANCE node. Actions: create_from_template (name, template, before?, save?) — new PLC project from a stock template; open (name, file=.plcproj/.tpzip, subType 0 copy/1 move/2 use-in-place, before?, save?) — import an existing project; info (treePath? default first under TIPC) — read identity (nestedProjectName/instanceName/childCount); set_boot_flags (treePath? = ROOT, autostart?, tmcFileCopy?) — config-only boot flags; plcopen_export (file, treePath? = INSTANCE, selection?) — write PLCopen XML; plcopen_import (file, treePath? = INSTANCE, options 0 NONE/1 RENAME/2 REPLACE/3 SKIP, selection?, folderStructure? default true, save?) — import PLCopen XML; save_as_library (file, treePath? = INSTANCE, install? default false — install:true mutates the local library repository) — save project as .library. GUARDED (live runtime/target writes), require confirm="ALLOW_PLC_DOWNLOAD" and default to no-op: generate_boot_project (treePath? = ROOT, autostart? default true) — generates the boot project to the target boot dir (restart runtime to load); online (command login/logout/start/stop/reset_cold/reset_origin, treePath? — changes live online/runtime state; the ConsumeXml envelope is UNVERIFIED on this build and surfaces GetLastXmlError verbatim, reset_* need a prior login, build>=4010). Safety projects are deliberately out of scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| name | No | ||
| save | No | ||
| action | Yes | ||
| before | No | insert before this sibling PLC project | |
| command | No | ||
| confirm | No | ||
| install | No | ||
| options | No | ||
| subType | No | ||
| template | No | ||
| treePath | No | ||
| autostart | No | ||
| selection | No | ||
| tmcFileCopy | No | ||
| folderStructure | No |