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
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 CORE
Open the home bar and start to configure the EtherCAT Master. Open the home bar and start to configure the EtherCAT Master
Add a new EtherCAT Master configuration. Add a new EtherCAT Master configuration
Select the correct port for the EtherCAT Master at XF 50. In this example the name is “ethercatmaster”. Select the port for the EtherCAT Master
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 link
Right click on the ethercatmaster and scan for new devices. Click on the EtherCAT Master and scan for new devices
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.
The ESI File can be downloaded from the offical website of the IO-Link Master supplier.
To install the ESI-File into the the device repository, click in the menu bar on tools and open the device repository.
Click on Install to add the current IO-Link Master - ESI-File to the device repository.
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 completed
Scan for new devices again, now the ifm IO-Link Master AL1930 should been detected.
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 project
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-Project
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.
The IO-Link Master channels need to be configured, because in this application only one sensor input is used. Configure the IO-Link Master channels
The temperature sensor is connected to channel one. The input process data length is set to 4 bytes. Connect the Temperature Sensor to Channel 1
The remaining channels will be set to "Deactivate Slot".
Once the configuration is completed, click on the “download the fieldbus configuration” button. Download the Fieldbus Configuration
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 slaves
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 Master
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 program
Set up a ctrlX PLC Engineering
Open the “Home” bar and click on the “Configure PLC applications” link.
Open the Home bar and click on the Configure PLC applications link
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 program
In the ctrlX PLC Engineering click in the menu bar on file, then on new project and select standard project.
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 project
Now the startup project tree looks like in the following picture. Startup Project Tree
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 Realtime
Add the fieldbus realtime data and apply changes. Add the Fieldbus Realtime Data and apply changes
Add the ifm Master AL1930 to the realtime data. Add the ifm Master AL1930 to the Realtime Data
Add IO-Link channel one and apply changes. Add IO-Link channel one and apply changes
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 changes
Now the IO-Link Master channel one only shows the configured bytes. The IO-Link Master channel one only shows the configured bytes
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 Application
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 GVL
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 Temperature
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 Sensor
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.
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 CORE
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 AoE
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 Program
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 Block
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 the product ID Read the Product ID
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
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.
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.
The application is started via the play button in the top menu bar or alternatively by right clicking on "Application" and press "Start". Start Application
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 false
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 Layer
GVL Overview GVL
PLC_PRG (To see the variables actual value, the bAcyclicExecute must be set to true, to start the acyclic reading process over AoE) PLC Program
Related Links
Video Set up a ctrlX PLC project to publish variables to the Data Layer
Get the ctrlX CORE - PLC app
Documentation ctrlX PLC app
Documentation ctrlX EtherCAT Master app
Forum ctrlX PLC
... View more