tc_tree
Manage TwinCAT tree items: read, create, rename, delete, import/export, and batch operations with error roll-up.
Instructions
TwinCAT System Manager tree items; paths use ^ separators (e.g. TIPC^MyPlc, TIID^Device 2 (EtherCAT)^Box 1). BATCH-FIRST: for more than one item use the matching *_batch action — N ops in ONE DTE attach, continue-on-error roll-up {count,succeeded,failed,results:[{...,ok,error?}]}, instead of an attach per call. Actions, grouped single / batch: READ identity — get / get_batch (paths:[...]); TEST existence — exists / exists_batch (paths:[...]); READ xml — get_xml (ProduceXml raw XML; summary:true for a compact identity + slot-module list); WRITE params — set_xml / set_xml_batch (items:[{path,xml}]) (ConsumeXml; compact unless returnXml:true); RENAME — rename / rename_batch (renames:[{name|path,newName}]) (keeps IO links intact); CREATE — create / create_batch (creates:[{parent,name,subType,before?,createInfo?}]); create VALIDATES the child and errors clearly on a malformed/ghost result instead of silently succeeding — adding an EtherCAT box needs a proper ESI-based createInfo (bare subType 9099 with no createInfo produces a blank-named ghost), recorded per-entry as ok:false; to ADD EtherCAT terminals/boxes from the ESI prefer the dedicated tc_ethercat tool; DELETE — delete / delete_batch (deletes:[{parent,name}], GUARDED: dryRun:true previews which children exist, confirm="ALLOW_TWINCAT_DELETE" to actually delete). Mutating *_batch verbs accept save:true to save once after the batch. No batch form: children (lists child items, incl. CPX-AP/Festo sub-modules), import (.xti under path), export (name to file), focus (Solution Explorer).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | ||
| file | No | ||
| name | No | ||
| path | No | ||
| save | No | ||
| items | No | ||
| paths | No | ||
| action | Yes | ||
| before | No | insert before this sibling | |
| dryRun | No | ||
| confirm | No | ||
| creates | No | ||
| deletes | No | ||
| newName | No | ||
| renames | No | ||
| subType | No | ||
| summary | No | ||
| reconnect | No | ||
| returnXml | No | ||
| createInfo | No |