IEC 60870 protocol

Configure IEC 60870-5 Protocol in a ctrlX CORE

New Contributor



In this tutorial, it will be shown how to use and configure the IEC 60870-5 protocol in the ctrlX CORE. For this purpose, a Codesys package from  3S-Systems GmbH will be used. This package allows to create a IEC 60870-5-104 server to which it is possible to send or receive data from a Slave. 

First, the package will be configured to be able to create the server. There, some information objects will be defined. These information objects are used to send or receive data from the slave or master. Once the server is running in the ctrlX CORE, a slave simulator will be used to send and receive commands from the server.Configuration

1. ctrlX CORE configuration

Note: It will be assumed that the user knows how to connect to the ctrlX CORE from the Engineering computer. Otherwise, check the following link: QUICK START GUIDE CTRLX CORE.

1. Connect the CtrlX CORE with the Engineering computer and access the ctrlX Automation interface.

2. Install the PLC app. The PLC app will be used to run the program that creates the server. 

  • To perform this step, it is recommended to follow the steps explained in this FAQ for ctrlX Store.

3. The app is installed. In the ctrlX CORE web interface, the “Settings” menu es clicked ->  Access “Apps” -> Change to “Service mode” because otherwise, it will not be possible to install the apps, and the “Install from file” button is clicked. A new window will be opened where the previously downloaded file is selected.

Settings access

ctrlX CORE apps installation

Once installed, the app will be visible as shown in the previous figure.

4. Access the PLC app. Go to Homepage, click over "Configure PLC applications" and "Start ctrlX PLC Engineering"

PLC program start

PLC program access

2. Install the Telecontrol Package

1. Download the Telecontrol program. The program can be found here. Download the app and keep the file in a reachable folder.

Telecontrol Configurator download

2. Return back to the PLC program and create a new project.

PLC Project creation

  • Select ctrlX CORE and click over "Ok"

ctrlX CORE selection when creating PLC program

3. Install the package. Click over "Tools" -> "Package Manager"

Package Manager access

  • Select the "Install" button and open the file downloaded from the Codesys store

Telecontrol Configurator installation

Telecontrol Configurator file selection

  • Accept the trust verification and start with the installation

    Allow package signature

Telecontrol Configurator installation

  • Follow all the steps and click over the finish button. 

Telecontrol Configurator installation

  • Close all the ctrlX PLC windows and the installation will automatically start. Once the installation has finished, the window shown in the next figure should appear. Click over "Finish", open the PLC program, and select the same project as before.

Telecontrol Configurator installation

Note: The PLC program can be opened from the ctrlX CORE interface as shown at the beginning of the tutorial, or from the ctrlX WORKS program in the Engineering Tools section.

ctrlX PLC program access

4. Add Telecontrol Configurator to the project: 1. Right click over "Device" -> 2. "Add Device"

First steps to add Telecontrol Configurator

  • 1. Select "Telecontrol Configurator" -> 2. Click "Add Device" -> Close the window

Add Telecontrol Configurator to PLC program

  • Now the following view should be visible:

Telecontrol Configurator Overview

5. Open the Telecontrol Configurator. Double click over "Telecontrol_Configurator (Telecontrol Configurator)" and the app interface opens.

Enter Telecontrol Configurator

Note: To briefly understand how the app works it is recommended to watch the following Youtube video 

3. Telecontrol package configuration

First, the IEC 60870-5 Server will be configured.

1. Configure the Link Layer

  • Select the type of client. In this case a Multi Client configuration will be used

Multi-client selection

  • Establish the TCP port. In this case the 2404 port will be usedTCP Port configuration

2. Configure the Station Address (also known as Common Address). When selecting the Station Address it is possible to define the address as shown in the next figure:

Station address configuration

When the ASDU address is changed, the address changes also automatically as shown in the left side of the figure. In this case, the ASDU address is 1.

Additionally, in this section, the information objects the user wants to use are created. In the "Add objects" section it is possible to choose between Monitoring and control direction objects.

Add objects Menu

As the names tell, the monitoring direction objects are used to "monitor" server status, and the control direction are used to send commands from any client connected to the server. 

Per default some Single-Point, Double-Point, Step-Point and Measured information objects are created with their individual Information Object Address (IOA). These addresses are very important because they identify each object inside of the server. The IOA can be configured by selecting the information object, and in the Object address section. When the object address is changed, the second format of the address also changes automatically. In this case, the IOA = 1.0.1 has been selected, and in the second format it is equivalent to 65537.

Single-point information object configuration

The same configuration can be done for the different information objects. For this tutorial, we will focus on the Measured values objects because the objective is to write some values over them.

3. Configure a Monitoring direction information object

To configure the 257 IOA, the following steps will be followed:

  • Type: Object 13
  • Object address: 0.1.1
  • IEE 754: Write "humidity" or any other variable name 
  • The other configurations are not relevant for this tutorial

Measured value Object configuration

4. Configure a Control Direction information object

In this case, a "Set point command" will be configured. This information object will be used to send a value from the slave.

To add this object, it is required to click over "Set point command" in the "Add objects" menu as shown here:

Set point Command object creation

Click over the new added information object, and fill the following blank spaces:

  • Type: Object 50
  • Object address: 0.2.2 = 514
  • IEE 754: The previously defined variable in the Measured value object should appear 

Set Point Command Object configuration

Note: It is important to remember the type of object because later it will be required to define the object again.

5. Generate the code. Press "F11" or click over the button shown in the following image:

PLC program code generation

Common problems:

  • In the case the PLC program is not able to generate the code, click over "sysTelecontrol_Task10" to change the priority

Task priority modification

6. Check some of the generated lines of code

  • In the "fbIEC60870_Server1 (FB)" section, at the end of the lines of code, the defined objects can be seen.

Information Objects Identification

  • In the same section it is also possible to read all the defined objects.

Object information identification

  • Each object has its identification has shown in the following image:

Object information identification

  • In the Global variables section, it is possible to read the variable defined in the "Measured value" object and which was also matched with the "Set-point command"

Global variables identification

7. Login and transfer the PLC program to the ctrlX CORE: Click over the button shown in the following figure.

ctrlX CORE log in

  • Enter the credentials


  • Click over the "Run" button

Run PLC program

Now the server is running in the ctrlX CORE, and we can try to send commands or read the values from a slave as it will be shown in the next chapter.

4. Slave simulator configuration

In this chapter, it will be shown how to create a "Simulated client" to test if the server is working as expected. For this purpose, the Client IEC 104 Simulator will be used. This program can be downloaded in the official webpage .

1. Install the "Client IEC 104 Simulator". Note: The "Server IEC 104 Simulator" is not required to install

2. Open the simulator and click over "Add client". Next, introduce the Server IP Address. This is the ctrlX CORE IP Address. Check that the Port number is 2404 and nothing else is required to change.

Slave configuration

3. In the "Data_Objects_1" section, click over "Start Communication" and if the server is correctly configured, a similar image as shown should appear:

IEC 60870-5 Server communication

As it can be seen, all the different objects defined in the Telecontrol Configurator appear here.

4. Send a command to the server

  • Right click over the main interface and select "Point Command"

Point Command Menu access

  • Select the Command object defined in the Telecontrol configurator. In this case: "Set Point Float

Enter Set Point Float Menu

  1. Check that the Object type matches with the one configured in the Telecontrol configurator
  2. Enter the IOA of the "Set-point command". In this case it was 514
  3. Enter a value that will be sent to the server
  4. Send Set Point Float Command

Set Point Float Configuration

  • Check that the value has been updated in the "Measured value" object. In this case it is the one with the IOA = 257.

Value change check

As it can be seen, the slave has successfully sent a command with the use of the command object and given this value to the measured value object.

1 Comment

Recommended to work with the IEC 60870-5-104 server version from Codesys, because version from Codesys still has bugs in it (status 10.11.2022).

Must Read