How-to Set up IO Link

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

Nürni
Member
Introduction

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.

Prerequisites
Hardware

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)

Software

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.
    Open the web based engineering of the ctrlX COREOpen the web based engineering of the ctrlX CORE 

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

  3. Add a new EtherCAT Master configuration.
    Add a new EtherCAT Master configurationAdd a new EtherCAT Master configuration 

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

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

  6. Right click on the ethercatmaster and scan for new devices.
    Click on the EtherCAT Master and scan for new devicesClick on the EtherCAT Master 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.
    Close device repository after installation is completedClose device repository after installation is completed

  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.
    Copy all EtherCAT devices from the control to the projectCopy all EtherCAT devices from the control to the project

  14.  Click apply and OK to create the device in the I/O-Project.
    Click apply and OK to create the device in the I/O-ProjectClick 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.
     Configure the IO-Link Master channelsConfigure the IO-Link Master channels

  17.  The temperature sensor is connected to channel one. The input process data length is set to 4 bytes. 
    Connect the Temperature Sensor to Channel 1Connect the Temperature Sensor to Channel 1

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

  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. 
    Current state of the EtherCAT Master and all connected slavesCurrent state of the EtherCAT Master and all connected slaves

  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. 
    Activate the expert settings to get access to all adjustments of the IO-Link MasterActivate 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.
    The NetID will be important for reading acyclic data with the upcoming PLC programThe 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.

    Open the Home bar and click on the Configure PLC applications linkOpen 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. 

    Start ctrlX PLC Engineering to create a PLC programStart ctrlX PLC Engineering to create a PLC program

  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. 
    Create a new standard projectCreate a new standard project

  5. Now the startup project tree looks like in the following picture. 
    Startup Project TreeStartup Project Tree

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

  7. Add the fieldbus realtime data and apply changes. 
    Add the Fieldbus Realtime Data and apply changesAdd the Fieldbus Realtime Data and apply changes

  8. Add the ifm Master AL1930 to the realtime data. 
    Add the ifm Master AL1930 to the Realtime DataAdd the ifm Master AL1930 to the Realtime Data

  9.  Add IO-Link channel one and apply changes.
     Add IO-Link channel one and apply changesAdd 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.
     Select channel TxPDO input byte 0 and input byte 1 and apply changesSelect channel TxPDO input byte 0 and input byte 1 and apply changes

  11.  Now the IO-Link Master channel one only shows the configured bytes.
     The IO-Link Master channel one only shows the configured bytesThe 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.
     Add a Symbol Configuration and a Global Variable List to your ApplicationAdd 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. 
    Insert the variables to the GVLInsert the variables to the GVL

  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". 
    This code will be used to evaluate the actual temperature and store it in the variable TemperatureThis code will be used to evaluate the actual 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. 
    At this point get the actual Temperature from the SensorAt this point 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. 
    Add the CXA EtherCAT Master Library to the PLC project to run the code on ctrlX COREAdd the CXA EtherCAT Master Library to the PLC project to run the code on ctrlX CORE

  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. 
    Add the program code to read inputs over AoEAdd the program code to read inputs over AoE

  19.  Now the function block needs to be inserted in the PLC program. For easier implementation, the input assistant can be used here.
     Use the Input Assistant to insert the Function Block to the PLC ProgramUse the Input Assistant to insert the Function Block to the PLC Program

  20.  If the user wants to see all IO's of the function block, the check box “insert with arguments” needs to be checked. 
    Check mark the Insert with Arguments box to see all IOs of the Function BlockCheck mark the Insert with Arguments box to see all IOs of the Function Block

  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 Read Vendor of the Converter Unit Read Vendor of the Converter Unit
    • Read the product ID Read the Product ID Read the Product ID
  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  Add Variables to the Symbol Configuration Add Variables to the Symbol Configuration
  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".
    Start ApplicationStart Application

  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.
    Use the Write Values in the Debug menu bar to change the Variables between true and falseUse the Write Values in the Debug menu bar to change the Variables 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. 
    Open Settings in the Web Interface of ctrlX CORE to view ctrlX Data LayerOpen Settings in the Web Interface of ctrlX CORE to view ctrlX Data Layer

2 Comments
jorgeponce
New Poster

Is it possible to configure the parameter of the sensor using the ctrlX as a "router"?

cc2go
Occasional Contributor

Use the ctrlX as router, for ifm Moneo or LR device, is supported and will work, with the ifm firmware which supports EoE.

Must Read
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist