Application sample – setting up an EtherCAT Master PC as a network bridge

The application samples have been tested with a test configuration and are described accordingly.
Certain deviations when setting up actual applications are possible.
In this sample, transmission is intended to take place from a subordinate PC via the EL6601 and EtherCAT and a Master PC into a superordinate network.

The following hardware was used:

Application sample – setting up an EtherCAT Master PC as a network bridge 1:
Setting up an EtherCAT-Master-PC as Network Bridge

To do this, the Master PC "TwinCAT Master" (B) must be setup as a TCP/IP bridge in order to route TCP/IP telegrams through to the subordinate CX1020 (C) or to relay them in the opposite direction. The partner device is a PC (A).
Distinction must be made between two cases here: static addresses and DHCP address assignment (network).

The following explanations assume the preceding samples as basic knowledge.

Computers (A), (B) and (C) have a static IP address

Application sample – setting up an EtherCAT Master PC as a network bridge 2:
Configuration of the network PC
Application sample – setting up an EtherCAT Master PC as a network bridge 6:
Checking the Configuration Bridge PC B
Application sample – setting up an EtherCAT Master PC as a network bridge 7:

"ipconfig" switches

Using the switches /release and /renew, the command ipconfig can be used to re-establish IP connections.

Checklist for connection settings:

Application sample – setting up an EtherCAT Master PC as a network bridge 8:

Observation of network traffic

 Experienced users can observe and evaluate the network traffic using a network sniffer, such as Wireshark.  

Application sample – setting up an EtherCAT Master PC as a network bridge 9:

Notice on Operating system Windows CE/embedded

Under Windows CE IP Routing must be set in the CX Configuration Dialog (see Fig. “Setting IP Routing in Windows CE”)
The entry “TCP/IP Settings” -> “IP Routing” sets the Registry-Key “IPEnableRouter”= 1 under [HKEY_LOCAL_MACHINE\Comm\Tcpip\Parms]
Restart required.
See also Microsoft Developer Network: Routing for IPv4 - Explanation on Routing.
Ordinarily the Routing table is automatically maintained, if necessary routes will still have to be added with “Route Add” command, see also Windows XP/7 etc.
Windows CE does not support some Routing protocols such as RIP or OSPF.

Application sample – setting up an EtherCAT Master PC as a network bridge 10:
Setting “IP Routing” in Windows CE

Network with DHCP address assignment

A connection between the PCs C and A (or the network) is not possible.

Explanation: Computers (A) and (B) receive their IP addresses from the DHCP server if the Ethernet ports are configured accordingly. One possible sequence is as follows (see RFC1541 and RFC2131):

This works for computers (A) and (B). The DHCPDISCOVER messages from computer (C) are accepted by the EL6601 and relayed in computer (B) to Windows via the EtherCAT port, but Windows (B) does not route these messages (and all other DHCP telegrams) through to the relaying Ethernet port – this function, known as DHCP Relay Agent, is only available in the server version of Windows.

This is the normal operating case when Windows PCs configured as DHCP devices are linked with each other.

Remedy: