Download: Substation (slave, balanced mode)

Simple substation application using the TwinCAT IEC 60870-5-101 low-level interface. This sample application can communicate with a central station via an RS232 interface.

Download TwinCAT XAE Project (*.zip): LowLevelSlaveSampleBal101.zip

In the sample project, the following station parameters are set for the substation:

Data point configuration (it should be the same as the data point configuration of the central station):

Sample implementation of the following services:

The following table briefly describes the main components of the project:

Component

Type

Description

P_MAIN_LowSpeed

PRG

This program part implements the telecontrol protocol (slow task).

P_SerialComm_HighSpeed

PRG

This program part implements TwinCAT background communication via the serial interfaces of the PC (fast task).

fbServer

FB_IEC870_5_101S (FB)

Implements the substation. An instance of this function block can only communicate with one central station. For each additional central station to communicate with, another instance of this function block is required.

fbServices

FB_IEC870_5_101SServices ( FB)

Includes a simple implementation of some services such as general interrogation, clock synchronization, test commands, etc.

stProcData

ST_IEC870_5_101SProcData (STRUCT)

Here you can found constantly updated process data – either received or to be sent.

sysPara

ST_IEC870_5_101SSysPara (STRUCT)

Configuration of the system parameters of the substation and the implemented services.

fbLog

FB_IEC870_DebugLogFifo (FB)

A simple log buffer for debugging/troubleshooting purposes.