Configuring an EL6695 EtherCAT bridge

The EL6695 is an EtherCAT bridge terminal for communication between two EtherCAT masters. It enables bidirectional data exchange between two independent EtherCAT segments. After the IO variables have been created, the configuration is completed using the cmdCreateConfiguration command via ConsumeXml.

Requirements

Configuring an EL6695 EtherCAT bridge 1:
// 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("<SelectItem/>");
        termEL6695.ConsumeXml(
            @"<TreeItem><Xml><AutomationInterface>
                <cmdCreateConfiguration/>
            </AutomationInterface></Xml></TreeItem>");

        // 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 <SelectItem></SelectItem> 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.

Configuring an EL6695 EtherCAT bridge 2:

The SubType parameter in CreateChild controls where the variable is inserted (0 = at the beginning; 1 = at the end).