Beckhoff Automation GmbH & Co. KG — 5.2.1 Building an EtherCAT topology

Configuration ' device = sysMan.LookupTreeItem("TIID^RTEthernet") device.ConsumeXml(xml) 5.2 Best practice 5.2.1 Building an EtherCAT topology This article explains how to build an EtherCAT topology via TwinCAT Automation Interface. It consists of the following topics:

General information Creating an EtherCAT device Creating EtherCAT boxes and insert into topology Creating EtherCAT terminals and insert into topology Exceptions to the ItemSubType 9099 Changing the "Previous Port" of an EtherCAT terminal Adding EtherCAT slaves to a HotConnect group All these topics cover the case of an offline configuration, which means the real addresses of all devices are not known at the time of config creation. The last chapter of this article therefore also explains how to Activate the configuration General information This documentation should give you an overview about how to create and handle EtherCAT devices and their corresponding topology via Automation Interface.

For an in-depth understanding about how EtherCAT works and how it is generally integrated in TwinCAT SystemManager/XAE, please consult the EtherCAT System Documentation and the corresponding chapter about EtherCAT configuration in TwinCAT . EtherCAT boxes and terminals, which are connected to an EtherCAT Master, share a common way of creation, which is explained in a separate article about E-Bus sub types [ } 43] . Creating an EtherCAT device The first step in creating a TwinCAT EtherCAT configuration is to create an EtherCAT device, which may involve either to create an EtherCAT Master, Slave or Automation Protocol (e.g. to use network variables, as covered in a separate article ).

To create an EtherCAT Master/Slave, simply make use of the ITcSmTreeItem [ } 62] :: CreateChild() [ } 62] method with the corresponding parameter for SubType (EtherCAT Master = 111, EtherCAT Slave = 130). EtherCAT Master - Code Snippet (C#) ITcSmTreeItem devices = systemManager.LookupTreeItem("TIID"); ethercatMaster = devices.CreateChild("EtherCAT Master", 111, null, null); EtherCAT Slave - Code Snippet (C#) ITcSmTreeItem devices = systemManager.LookupTreeItem("TIID"); ethercatSlave = devices.CreateChild("EtherCAT Slave", 130, null, null); Automation Interface 23 Version: 1.2