tc_ethercat
Create native EtherCAT IO boxes (terminals/couplers) in TwinCAT by specifying product strings. Supports revision pinning, insertion ordering, and multi-coupler designs.
Instructions
Create EtherCAT IO boxes (terminals/couplers) NATIVELY. Each module is added via the GUI's own "Add Box" route — ITcSmTreeItem.CreateChild(name, 9099, before, "") — so TwinCAT expands the box FROM ITS OWN ESI: a fully populated, non-hollow box (correct identity, SyncManagers, FMMUs, full mailbox/CoE/FoE element, complete PDOs+entries) for ANY class — digital, analog (in AND out), IO-Link, mailbox, DC, couplers. createInfo is the PLAIN PRODUCT STRING (the bare type = latest revision, or a revision-pinned form), NOT identity XML/numbers. ONE unified shape — a single box and a whole multi-coupler design are the SAME operation: racks:[{ parent:"<EtherCAT coupler/master tree path>", modules:[{ type:"EL1008", name?:"Term 7 (EL1008)", revision?, before?:"" }] }]. A single box is just racks:[{parent, modules:[{type}]}]. Modules are created in array order (left-to-right terminal order); before inserts ahead of a named sibling; name omitted defaults to type. Revision pinning: pass revision as the full Beckhoff product string suffix "-" (decimal), e.g. type:"EL1008" revision:"0000-0017" → RevisionNo #x00110000; you may also pass the whole pinned string in revision (e.g. "EL1008-0000-0017"). Bare type = latest revision. NO fallback — if CreateChild produces a ghost/unknown type, that ONE module is a clean ok:false (any stray child is cleaned up) and the rest continue. Optional save:true saves the solution once after everything. Returns a flat roll-up {count, succeeded, failed, results:[{parent, type, name, ok, error?}]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | ||
| racks | Yes |