ctrlX PLC app
Telecontrol Configurator (Demo license valid for 30 minutes)
Note: It is recommended to use version 220.127.116.11. because version 18.104.22.168 has some bugs
Client IEC 104 Simulator
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.
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"
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.
2. Return back to the PLC program and create a new project.
Select ctrlX CORE and click over "Ok"
3. Install the package. Click over "Tools" -> "Package Manager"
Select the "Install" button and open the file downloaded from the Codesys store
Accept the trust verification and start with the installation
Follow all the steps and click over the finish button.
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.
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.
4. Add Telecontrol Configurator to the project: 1. Right click over "Device" -> 2. "Add Device"
1. Select "Telecontrol Configurator" -> 2. Click "Add Device" -> Close the window
Now the following view should be visible:
5. Open the Telecontrol Configurator. Double click over "Telecontrol_Configurator (Telecontrol Configurator)" and the app interface opens.
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
Establish the TCP port. In this case the 2404 port will be used
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:
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.
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.
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
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:
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
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:
In the case the PLC program is not able to generate the code, click over "sysTelecontrol_Task10" to change the priority
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.
In the same section it is also possible to read all the defined objects.
Each object has its identification has shown in the following image:
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"
7. Login and transfer the PLC program to the ctrlX CORE: Click over the button shown in the following figure.
Enter the credentials
Click over the "Run" button
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.
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:
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"
Select the Command object defined in the Telecontrol configurator. In this case: "Set Point Float"
Check that the Object type matches with the one configured in the Telecontrol configurator
Enter the IOA of the "Set-point command". In this case it was 514
Enter a value that will be sent to the server
Send Set Point Float Command
Check that the value has been updated in the "Measured value" object. In this case it is the one with the IOA = 257.
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.
... View more
In this tutorial, it will be shown how to connect a ctrlX CORE with a Raspberry Pi using the Slave port (XF51).
It will be necessary to make some configurations in both devices. Firstly, the ctrlX CORE will be configured and secondly the Raspberry Pi.
1. ctrlX CORE Configuration
Firstly, it is required to connect the ctrlX CORE with the Engineering computer. For this purpose, it is just needed to follow the steps shown in the article: ctrlX CORE and Computer Connection.
Once successfully connected to the engineering computer, it is possible to configure the ctrlX CORE to be able to connect to the Raspberry Pi.
1. Go to "Settings"
2. Press "Connectivity"
3. Access the "eth1" interface
4. In the "IPv4" section, write the desired static IP address. For this article, the used IP address will be: 22.214.171.124/24. Important to add /24 because otherwise it will not be possible to assign this IP address. Note: /24 provides the subnest mask 255.255.255.0.
In the “IPv6”, “Routing” and “Security” sections it is not required to perform any change.
5. Activate IP forwarding
6. Once everything has been configured, click over "Save", as shown in the previous figure.
After a few seconds, in the top of the configuration interface, a message with "Network changes applied successfully" will appear confirming that the configuration has been correctly saved.
7. Finally, it is important to check that for the eth0 interface, IP forwarding is also enabled.
Otherwise, enable it, and click over "Save".
2. Raspberry Pi Configuration
Note: For this process, it will be assumed that the Raspberry Pi has been completely set up. Additionally, it will be assumed that there is access to the desktop interface with a screen. Otherwise, it will be required to perform all the configuration per terminal commands.
1. Connect the Raspberry Pi with an ethernet cable through the slave port in ctrlX CORE (XF51 port).
2. Access to network settings. Right click over the symbol shown in the following image and click over "Wireless and Wired Network Settings".
3. In the Network Preferences window, the eth0 interface is selected and the following steps are followed to configure the static IP address:
Uncheck “Automatically configure empty options”
“Disable IPv6” can either be checked or not.
“IPv4 Address”: An IP address that needs to have 180.254.3.X as a mandatory requirement, and the last number can be anyone that is not 1 (or the one configured in the ctrlX CORE)
“IPv6 Address”: Nothing is needed to be entered
In “Router” the IP address defined in the eth0 interface (in the CtrlX CORE) needs to be inserted. In this case: 126.96.36.199
“DNS Servers”: Nothing is needed to be added
“DNS Search”: Nothing is required to add
Once, the gaps have been filled, press "Apply", and close the window.
NOTE: To finish the configuration, it is required to unplug and plug the Ethernet cable again to establish the connection with the defined static IP address.
1. Raspberry Pi Testing
In the case we would like to test the connection, we can open the terminal in the Raspberry Pi and write the following command: ping <IP address>.
In the case the Raspberry Pi is correctly configured, there should appear messages like in the shown image.
2. Engineering computer connection test
In the case we want to test the connection from the engineering computer we have to follow the following steps:
1. Open terminal with administrator rights
2. Write the command:
route add 188.8.131.52 mask 255.255.0.0 192.168.1.1
After executing this command, the message “OK!” should appear.
3. Test connection with ctrlX CORE. The ping command is used:
If the Ping statistics show that 4 messages were send, 4 were received and 0 lost it means that the connection has been successful.
4. Test connection with Raspberry Pi. Here it is needed to enter the IPv4 address defined in the Raspberry Pi. The ping command is used:
... View more