beckhoff — 12.4.2 Methods of the ActiveX control

Appendix | Appendix D: EtherCAT Topology ActiveX Control Parameter TCatSysManagerLib.ITcSmTreeItem pEtherCATDevice interface to the Systen Manager treeItem interfaces of an EtherCAT device Syntax (C#) void ShowOfflineTopology(TCatSysManagerLib.ITcSmTreeItem pEtherCATDevice) Member of IEcTopologyCtrl GetEnumEtherCATDevices Description With the help of GetEnumEtherCATDevices one receives an enumeration interface for the open EtherCAT Devices in the TwinCAT system. With this interface one can enumerate over the individual EtherCAT devices and one can read out the name and the DeviceId of these EtherCAT devices.

Parameter out IEnumEtherCATDevices ppEnum Interface IEnumEtherCATDevices Syntax (C#) void GetEnumEtherCATDevices(out IEnumEtherCATDevices ppEnum) Member of IEcTopologyCtrl Example(C#) //Get DeviceId via IEnumEtherCATDevices interface IEnumEtherCATDevices devices; IEtherCATDevice device; axEcTopologyCtrl1.GetEnumEtherCATDevices(out devices); uint fetched = 0; do { devices.Next(1, out device, out fetched); if (fetched == 1) Console.WriteLine(String.Format("Name:{0} Device Id:{0:d}", device.Name, device.DeviceId)); } while (fetched == 1); TwinCAT 2 450 Version: 1.7