EL6695 - EtherCAT Bridge Terminal

Custom configuration for the EL6695 bridge Module

alekyha_circle

EL6695 - EtherCAT Bridge Terminal

Motivation and content

We often face the issue that we require communication between two EtherCAT masters. Examples include communication between a National Instruments cRIO system and a Simulink Real-Time Speedgoat system, or communication between two Speedgoat systems. How is this done? The Beckhoff EL6695 offers the solution.

When using this EL6695 bridge module over the past few years, we have generally found the setup to be somewhat counter-intuitive. The Beckhoff documentation is, well, not exactly succinct. We wrote up this blog to remind ourselves of the EL6695 setup process, and hope this helps you too.

This blog covers:

  • What does the EL6695 bridge module do?
  • Hardware requirements for this blog (if using the Online configuration option)
  • EL6695 Online configuration (follow this if you have access to the EL6695 module)
  • EL6695 Offline configuration (follow this if you don’t have access to the EL6695 right now)
  • Introduction to the PDOs on the EL6695
  • Adding custom PDOs on the EL6695
  • Downloading custom PDO configurations to primary and secondary sides (this is a key step – follow this carefully)

What does the EL6695 bridge module do?

The EL6695 bridge terminal enables real-time data exchange between two EtherCAT masters. The hardware specifications of the terminal can be found here. The EL6695 can be very useful in applications where controller processing needs to be divided between two machines. For example, one master can run the control algorithm and another can act as a data acquisition master. It can be also used to expose the data from one controller to another in real time without exposing the control algorithm.

The EL6695 bridge has two sides known as the primary and the secondary sides. The primary side slave is on the E-bus side (e.g. to EK1100 bus coupler) and connects to the first master. The secondary side is connected as a slave module on the second master side. In our experience, it doesn’t really matter which master is primary or secondary. Inside the EL6695, a micro-controller transfers data between the two masters. In essence, the EL6695 is a module with two slaves (one for each master) and a micro-controller that transfers data between these two slaves.

EL6695 EtherCAT bridge module hardware requirements (for Online Configuration)

To follow along with the online configuration option, you will need the following equipment:

  • EL6695 bridge module
  • EK1100 EtherCAT coupler
  • RJ45 Ethernet Network cable
  • Windows Computer
If you follow the offline configuration (see further below), you will only need a Windows Computer.

EL6695 EtherCAT bridge module setup: Online Configuration

An online configuration can be undertaken when the hardware is connected to the network. First, connect the EK1100 EtherCAT coupler and the El6695 via the E-bus. Both the EK1100 and EL6695 will need a 24 V power supply. Note that the EL6695 will appear to work okay at first without a separate 24V supply. However, the secondary side will not reach state OP unless 24V is connected to the bottom X3 connector. The final setup is as shown in the image below.

 

Download and install TwinCAT on a Windows computer. The latest version at the time of writing is v3.1.

Startup TwinCAT after installation and install the TwinCAT real-time driver. This has to be done to assign real-time EtherCAT capability to the Ethernet port on Windows. In TwinCAT 3, select TwinCAT -> Show Realtime Ethernet Compatible Devices.

A list of Ethernet adapters on the computer should show up as below. The Ethernet adapter connected to the EK1100 shows up under Ethernet Adapter. Click on the adapter and select Install from the menu on the right.

You should now be able to Scan the network devices. Start TwinCAT and create a New TwinCAT Project. Select TwinCAT Projects -> TwinCAT XAE Project (XML format). Select the directory for the project under Location, select an appropriate name for the project and click OK. For the  demo here, we will be using the project name EL6695_Demo.

We will now add the EtherCAT network to our TwinCAT project. Under I/O, right click on Devices and select Scan.

Click on OK for the message prompt. You will get a list of I/O Devices Found. Select the I/O device Device X (EtherCAT) – Device 4 in our example – and click on OK.

Select Yes for Scan for boxes prompt. Your project should now have a network similar to below image. There is no need to have the EL6090 display module shown in our network. We simply use this display module for debugging purposes, but this is not required for the EL6695 setup. The EL9011 is the bus end cover, which is automatically added by Beckhoff, independent of whether this is actually connected.

EL6695 EtherCAT bridge module setup: Offline Configuration

Assuming you had access to the EL6695 hardware (following the online configuration steps above), you can skip this section and move straight to the PDO sections below.

It is possible to add the EL6695 bridge device in Offline configuration when the terminal is not physically accessible. On downloading TwinCAT 3, most of the Beckhoff device descriptors and EtherCAT Slave Information (ESI) XML files are also downloaded under C:\TwinCAT\3.1\Config\Io\EtherCAT.

Note: If you place new or custom files in this directory (e.g. a motor drive ESI) click Reload Device Descriptions as shown below. This is NOT required for this blog, but will be useful in other applications.

To add a Device in Offline mode, Right Click on the Device-> Add New Item

 

First, select the EK1100 bus coupler from Devices List

 
 

Right click on the EK1100 terminal and select Add New Item

 

Select the EL6695 EtherCAT Bridge terminal (Primary) from the Devices List.

 

Your network should now resemble the online configuration discussed above. You can add IO Inputs and IO Outputs as needed (see PDO sections below). The offline configuration can now be exported and used in Simulink Real-time or other real time applications.

Introduction to PDOs on the EL6695 EtherCAT bridge module

The data exchange between the two masters (primary and secondary) happens using Process Data Objects – PDOs. The data sent from the primary side to the secondary side are known as RxPDOs. Data received from the secondary side to the primary side are known as TxPDOs. For more information on EtherCAT structure, please refer to the Beckhoff documentation.

We will focus on “Symmetric PDO mapping” for the EL6695 in this blog, where the two sides of the EL6695 have the same process data in terms of the data bit size and sequence. It is important that the PDO mapping matches on both sides of the EL6695. Any mismatch will prevent the two slaves to enter Operational (OP) state. The outputs written on the primary side are presented to the secondary side as inputs and vice-versa. The image below shows the IO mapping between two sides of the EL6695 terminal.

The primary side is defined by Beckhoff as “EL6695”, and the secondary side is “EL6695-0002”. In our example, we have already mapped 40 channels (the limit is 100 channels) between the primary and secondary sides. We will show how to add additional channels in the next section. With our existing 40 channels, the primary side inputs (left) and secondary side outputs (right) look as follows.

Our naming convention here is “S2P”, which stands for Secondary to Primary. We try to avoid the words “input” and “output” in the channel names, as an input on one side is an output on the other side. In the example above, the S2P data entries are inputs on the primary side (left) and outputs on the secondary side (right).

The secondary side is represented as EL6695-0002. The below image shows inputs on the secondary side (right), and the corresponding outputs on the primary side (left). Our naming convention for this direction of data flow is P2S (Primary to Secondary).

 

Adding custom PDOs to the EL6695 EtherCAT bridge module

For a new PDO configuration to work, both the primary and secondary side configurations must match. Please follow the instructions in this section and also the following two sections (download primary and secondary side configurations) carefully and fully. Any mismatch will prevent the slaves from entering OP state.

Make sure the device is in Config Mode (see bottom right of TwinCAT). If not, click on the config mode icon in the top toolbar to restart TwinCAT in config mode. Also make sure the EL6695 is in PREOP (Pre-Operational) state.

If your device is new it will have no existing PDO configuration. Either way, you should load the current device configuration before making changes. First, make sure your device is Online (CoE-Online tab).

Next, go to the Process Data tab and click on Load PDO info from device.

This loads the current configuration. In our case, the device already has 40 double (64 bit) IO Inputs and IO Outputs. We will add a new TxPDO and RxPDO to the setup. To do this, right click on the IO Input->Add New Item.

Provide a variable name, and select the variable datatype. Repeat these steps for the IO Output as well. We are creating an Output variable P2S_New of type INT and Input variable S2P_New if type INT.

Downloading a new PDO configuration to the EL6695 EtherCAT bridge module

We now need to “download” the created/modified configuration to the EL6695 terminal. The way this works is that the PDO configuration download from the primary side (which is currently connected) is actually downloaded to the secondary side. Let’s repeat this – yes(!), the primary side PDO configuration is downloaded to the secondary side.

Select the EL6695 Terminal, go to the EL6695 Tab, click on ProcessData and click on Create configuration. Again, make sure the terminal is in PREOP state.

The above step should result in a successful download.

Configuring the EL6695 secondary side

Let’s move on to the secondary side. Connect the IN X1 port of the secondary side to the Windows computer using a standard network cable. This is the white Ethernet cable in the image below. EL6695 module Now, perform Load PDO info from device as described above This should display the configuration we created and downloaded from the primary side, including the new PDOs – S2P_New and P2S_New. Note that this configuration is available on the secondary side, even though we downloaded this when connected to the primary side. We will now need to repeat the same step for Create Configuration on the secondary side. This step will download the PDO configuration from the secondary side to the primary side. This is probably the most confusing part of the setup process, but the only way we have found to make the EL6695 configuration work. Let us know if you have found a better way!

Putting the EL6695 EtherCAT bridge module into OP state

We are now connected back to the primary side. Finally, you can Load PDO info from device on the primary side. The below images shows the before load view (right, no PDOs are showing as input / output) and after load PDOs (left, our existing 40 PDOs AND the new entries are shown). el6695 i/o

Conclusion

The EL6695 bridge module is finally configured as per our requirements and in OP state. We can now write PLC code using the TwinCAT master, MATLAB Simulink Real-time code for the Speedgoat target, or LabVIEW code for the National Instruments cRIO. Each of those real-time targets could be the primary or secondary master, and we can perform data exchange between the two masters in real-time as needed.

While sometimes fiddly to setup, EtherCAT is a very powerful protocol. We will keep writing blogs on different features of the EtherCAT protocol. Let us know if you have something specific in mind that you would like us to write on.