beckhoff TE1000 TwinCAT 3 — 6.6.20 Configuring an EL6695 EtherCAT bridge

Samples | I/O // nodePathList: list of all TreeItem paths — e.g. built via ProduceXml on TIID foreach (string pathName in nodePathList) { if (pathName.Contains("EL6695")) { ITcSmTreeItem termEL6695 = sysManager.LookupTreeItem(pathName); ITcSmTreeItem ioInputs = sysManager.LookupTreeItem(pathName + @"^IO Inputs"); ITcSmTreeItem ioOutputs = sysManager.LookupTreeItem(pathName + @"^IO Outputs"); // Create IO variables — order:

3, 2, 1 (param=0 inserts at the front) ioInputs.CreateChild("InputVar3", 0, null, "BYTE"); ioInputs.CreateChild("InputVar2", 0, null, "BYTE"); ioInputs.CreateChild("InputVar1", 0, null, "BYTE"); ioOutputs.CreateChild("OutputVar2", 0, null, "BYTE"); ioOutputs.CreateChild("OutputVar1", 0, null, "BYTE"); // Create configuration (SelectItem + cmdCreateConfiguration) termEL6695.ConsumeXml(" "); termEL6695.ConsumeXml( @" "); // Read back current configuration and reapply string strXml = termEL6695.ProduceXml(); termEL6695.ConsumeXml(strXml); } } The process follows a set sequence: 1. creating variables, 2. calling SelectItem, 3. executing cmdCreateConfiguration, 4.

ProduceXml/ConsumeXml to finalize. The corresponds to manually selecting the terminal in the TwinCAT interface and is necessary for the cmdCreateConfiguration command to take effect. cmdCreateConfiguration is processed by a command in the fieldbus extension that (re)generates the bridge configuration. The SubType parameter in CreateChild controls where the variable is inserted (0 = at the beginning; 1 = at the end). TE1000 272 Version: 1.7.0