Set up IO-Link Master and IO-Link Sensor and connect it to ctrlX CORE using EtherCAT


This guide shows how to operate an IO-Link Master to read acylic process data using ADS over EtherCAT (AoE) and cyclic procress data from an IO-Link sensor with the EtherCAT interface on a real ctrlX CORE.  This application note leads step by step through the whole process, from hardware setup through engineering until testing.

ctrlX AUTOMATION has been designed as an open system. In context of IO-Link this means that it supports any IO-Link master which fulfills the requirements of the EtherCAT specification (ETG.5001) and provides a suitable ESI file.

ctrlX I/O Engineering does not support IO-Link configuration using IO-Link Device Description (IODD) files. Configuration is done via EtherCAT Modular Device Profile (MDP) mechanisms.

In our example we have chosen devices from ifm, but others can be used accordingly.


Following devices will be used in this application note:

  • ctrlX CORE hardware
  • IO-Link Master (ifm AL1930)
  • IO-Link Temperature Sensor (ifm TS2289)
  • IO-Link Signal Converter (ifm TP3231)


Following software must be installed:

  • Rexroth PLC app on the ctrlX CORE
  • Rexroth EtherCAT Master app on the ctrlX CORE
  • ctrlX I/O Engineering and PLC Engineering (parts of ctrlX WORKS)

For operation of Rexroth PLC app and Rexroth EtherCAT Master an adequate software license is required!

Set up a ctrlX I/O Engineering
  1. Open the web based engineering of the ctrlX CORE either via your network folder of Microsoft Windows, from ctrlX WORKS or directly by entering the IP in a web browser and login.

  2. Open the home bar and start to configure the EtherCAT Master. 

  3. Add a new EtherCAT Master configuration.

  4. Select the correct port for the EtherCAT Master at XF 50. In this example the name is “ethercatmaster”.

  5. The system will create the EtherCAT Master. When this is successful, open the ctrlX I/O Engineering by clicking on the corresponding link.

  6. Right click on the ethercatmaster and scan for new devices.
  7. The ctrlX CORE will find the ifm IO-Link Master, but the device is unkown, because the ESI File isn´t installed in the device repository of IO Engineering. As long as a slave device is unkown, it can´t be insert to the fieldbus configuration. 
  8. The ESI File can be downloaded from the offical website of the IO-Link Master supplier. 
  9. To install the ESI-File into the the device repository, click in the menu bar on tools and open the device repository.
  10.  Click on Install to add the current IO-Link Master - ESI-File to the device repository.
  11.  Once the installation is completed, the installed device descriptions will be displayed and the device repository can be closed.

  12.  Scan for new devices again, now the ifm IO-Link Master AL1930 should been detected.
  13.  Click on the “insert all newly scanned devices”-button in order to copy all EtherCAT devices from the control to the project.

  14.  Click apply and OK to create the device in the I/O-Project.

  15.  In this example, there is only one sensor connected to channel one of ifm AL1930. Therefore channel one has to be activated by selection of the appropriate process data size. Remaining channels must be deactivated. The process data length and layout can be found in the corresponding data sheet. In case of ifm Signal Converter TP3231, the length is two Bytes.
    If the appropriate process data size can not be found in the selection, the next best fitting (larger) process data size has to be chosen.

  16.  The IO-Link Master channels need to be configured, because in this application only one sensor input is used.

  17.  The temperature sensor is connected to channel one. The input process data length is set to 4 bytes. 

  18.  The remaining channels will be set to "Deactivate Slot". 
  19.  Once the configuration is completed, click on the “download the fieldbus configuration” button. 

  20.  After the fieldbus configuration is downloaded successfully to the ctrlX CORE, the EtherCAT status should be switched to “OP”. To validate this, you can click on the “EtherCAT” bar to see the current state of the EtherCAT Master and all connected slaves. The fieldbus configuration can now also be seen in the ctrlX CORE Data Layer. 

  21.  To get the signal from the connected temperature sensor to the PLC, the IO-Link Master must be configured as an IO-Link user, which using the AoE (ADS over EtherCAT) Protocol.  In order to see the AoE-address, open ctrlX I/O Engineering and double left click on ifm IO-Link Master to open the settings. Now activate the expert settings to get access to all adjustments of the IO-Link Master. 

  22.  Open the AoE tab and automatically AoE is enabled. When AoE is activated, then save the I/O-project and download the configuration to the control and accept the upcoming wizard. The NetID will be important for reading acyclic data with the upcoming PLC program.

Set up a ctrlX PLC Engineering
  1. Open the “Home” bar and click on the “Configure PLC applications” link.


  2. Initially, there is no PLC program on the ctrlX Core. To create a PLC program, open the ctrlX PLC Engineering via the "Start ctrlX PLC Engineering" button. 


  3. In the ctrlX PLC Engineering click in the menu bar on file, then on new project and select standard project. 
  4. When a new standard project is selected, the program will ask you for which device you want to create the project and which programming language for your PLC program should be used. In this example, the device is a real ctrlX Core and structured text (ST) is selected. 

  5. Now the startup project tree looks like in the following picture. 

  6. To configure the ctrlX CORE Realtime Data right click on DataLayer_Realtime, Edit and then "Online from ctrlX Core".

  7. Add the fieldbus realtime data and apply changes. 

  8. Add the ifm Master AL1930 to the realtime data. 

  9.  Add IO-Link channel one and apply changes.

  10.  The converter unit only provides two bytes of process data. Select channel TxPDO.input_byte_0, TxPDO.input_byte_1 and apply changes.

  11.  Now the IO-Link Master channel one only shows the configured bytes.

  12.  To be able to publish variables to the ctrlX CORE Data Layer, two things need to be insert to the project. Add a symbol configuration and a global variable list to your application.

  13.  Insert the variables to the GVL and delete the preinsert first line. In this example, one boolean variable "bAcylicExecute", two bytes "ByInputByte0" and "ByInputByte1", one word "PDV1" and one real variable "Temperature" are defined. 

  14.  The two bytes of the cyclic process data will be divided into two spearated bytes "ByInputByte0" and "ByInputByte1". This two bytes will be joined to an word and then converted into an integer value. The following code will be used to evalutate the acutal temperature and store it in the variable "Temperature". 

  15.  At this point of the example, it is possible to get the actual temperature from the sensor. 

  16.  The variable “bAcyclicExecute” will be used to start the acyclic read of the vendor and the product ID. Set up an example program in the "PLC_PRG" where “strVendor” shows the vendor of the converter unit and "strProductID" shows the Product ID. 

  17.  To run the code on the ctrlX CORE, open the library manager. Press the “Add Library” button. Search for CXA_EthercatMaster and double left click on the “CXA_EthercatMaster” library or press the OK button to add the library to the PLC project. 

  18.  After integration of the CXA_EthercatMaster library, you can add the program code to read inputs over AoE. In the declaration part of the PLC_PRG some new variables must be added, like in the picture below. 

  19.  Now the function block needs to be inserted in the PLC program. For easier implementation, the input assistant can be used here.

  20.  If the user wants to see all IO's of the function block, the check box “insert with arguments” needs to be checked. 

  21.   This is how it looks like, when all arguments are be insert and the variables are allocated to the IOs.
    • Read vendor of the converter unit 44.png
    • Read the product ID 46.png
  22.  There are two ways to add these variables to the symbol configuration:
    • Execute a “Build” and tick the variables you like
    • Add a pragma to the global variable list that causes all variables in this list to be published 47.png
  23.  The communication settings are set automatically by default, so it is possible to directly log into the control. In order to inspect the settings, double click on the target on the left hand side.

  24.  A security warning will be displayed because the certificate for the communication is self-signed and thus not provided by an official certificate authority. Please go on logging in with your user and password available on the control and download the created project.

  25.  The application is started via the play button in the top menu bar or alternatively by right clicking on "Application" and press "Start".

  26.  Now variables can be manipulated in your program PLC_PRG. To manipulate the the value of bAcyclicExecute double left click on it in the PLC_PRG and then press "CTRL + F7" or alternatively use the "Write Values" in the "Debug" menu bar to change between true and false.

  27.  To check the data in the ctrlX Data Layer, open the viewer via the link in the "Settings" bar in the web interface of your ctrlX CORE. There the variables are visible and changeable. Please refresh the view with the small button on right if the values are static. 

Hi, I am Mike and I work as a fieldservice technician in the ctrlX AUTOMATION service team.

Must Read

1 Comment