Commissioning Example - Beckhoff TwinCAT with CIFX RE as EtherCAT Slave (SYCON.net)

Introduction

This application note represents a complete commissioning guide, using TwinCAT.

In this example, a Hilscher CIFX Card (CIFX 50 / 70 / 80 / 90) is configured for use as an EtherCAT Slave, to communicate with TwinCAT as an EtherCAT Master.


The download package provided below, contains the used SYCON.net project for configuration of the CIFX Card, as well as the used firmware and ESI file.

It also provides the full TwinCAT 3.1 project, which creation is explained step by step in this commissioning example:

Download content:

File
used Version
SYCON.net_Project.zip

SYCON.net project

SYCON.net V1.500 Build 211209
cifxecs.nxfEtherCAT slave firmwareV4.9.0.1
Hilscher CIFX RE ECS V4.6.X.xmlCIFX ESI fileV4.6.x
TC_Project.zipTwinCAT 3 projectV3.1 Build 4022.16

Please note, that before starting with commissioning in TwinCAT, the firmware and configuration needs to be downloaded to the CIFX Card.

Otherwise, the CIFX Card will not work as an EtherCAT Slave and will therefore not be able to communicate to TwinCAT.

Setup

For this commissioning example, you will not need a dedicated PLC. TwinCAT can work together with your Network interface card (NIC) as an EtherCAT Master.

To use TwinCAT with your Network interface card as a Master, the NIC requires a Chipset that is supported by Beckhoff.

The supported Chipsets are listed here:

Beckhoff Information System


Connect your network interface card and the CIFX card with a standard Ethernet cable.


Now put the ESI file from the provided .zip archive into the proper TwinCAT folder.

The default path is: C:\TwinCAT\3.1\Config\Io\EtherCAT

How to Install TwinCAT Driver for Network Interface Card

If you are using TwinCAT for the first time, you have to make sure the proper driver is installed for your compatible network interface card.

To check this and possibly install the driver, open TwinCAT and go to "TwinCAT" → "Show Realtime Ethernet Compatible Devices...".

A new window opens, displaying all your network interface cards.

If there is already a card in the category "Installed and ready to use devices", no further steps are required.

If no card is visible in this category, highlight your supported network interface card in another category (even if it is stated as "incompatible") and click "Install".

After the driver is installed, you can continue with the tutorial.

Create a new Project

  • Start TwinCAT 3 to create a new project

  • Click on "New TwinCAT Project" and choose the option "TwinCAT Project".
    Then enter a name for your project and click OK

  • The screenshot below, shows the newly created empty project:

Add the Master (NIC)

  • The first step is to add your network interface card as the EtherCAT Master
  • Therefore, right-click on "Devices" and select "Add New Item..."

  • Select the "EtherCAT Master"

  • Now select the Network interface card, that is dedicated to work as the EtherCAT Master

Add the CIFX RE/ECS

  • To add the CIFX card as an EtherCAT Slave, do a right-click on the Master (Device 1 (EtherCAT)) and select "Add New Item..."

  • Now locate the CIFX card in the device catalog and click "OK"

  • You now see the CIFX card added as "Box 1"

Alternatively: Scan for Connected Devices

Instead of adding the CIFX card as described above, you can use the "Scan"-function implemented in TwinCAT.

  • Therefore, right-click on the EtherCAT Master and select "Scan"

  • The CIFX card will be added as "Box 1", as shown previously

Change System to "Operational" State

  • Upon adding the CIFX card as a Slave, it will be in Pre-Operational state (PREOP)

  • To start process data exchange, the bus needs to be in Operational state (OP)

  • Simply click on "Toggle Freerun" and the Master will initialize the state change from PREOP to OP

Diagnosis

  • If currently no data is sent by the Slave to the Master, you should now see the Input Data (TxPDO) being all zero

Reload Devices

  • If the displayed data does not correspond to the actual expected values, click on "Reload Devices":

Read and Write Data with CIFX RE ECS

To read and write data via a CIFX Card, the IO Monitor of the Tool "cifX Test" can be used.

The IO Monitor is used to send and receive IO Data, to check the current communication.

It does only work if a communication is already successfully established.


cifX Test is part of the CIFX Device Driver installation and is available in the Driver folder:

C:\Program Files\cifX Device Driver\cifXTest.exe


  • Execute "cifXTest.exe"
  • Click "Device → Open" and select the EtherCAT Protocol Channel of the used CIFX Card

  • Open "Data Transfer → IO Monitor"
  • In the "Length field" of the Process Data Input Image area, enter the number of bytes to be displayed.
    Then click into the "Data" field

  • In the Data field of the Process Data Output Image area, enter output data to be sent to the Master and click "Update", to send said data

  • You can also use the functions "Cyclic" and "Auto Increment Data", to make it change automatically


  • To send data from the Master to the Slave, highlight RxPDO, right-click on the value you want to manipulate and choose "Online-Write"

  • In the following window, enter a value in one of the presented data types and click "OK"

  • To validate that it has worked, bring up the cifx Test tool again

  • You now have a working, simple EtherCAT network.