Download: Substation Minimal (slave, unbalanced mode)

Simple substation application using the TwinCAT IEC 60870-5-101 high-level interface.

Download TwinCAT XAE Project (*.zip): MiniSlaveSample101.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_101Slave (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.

bSPI

BOOL

The ON/OFF value to be sent is mapped directly from the flag address AT%MX1.5 of this allocated PLC variable.

bSCS

BOOL

The received ON/OFF value is mapped into this PLC variable directly to the allocated flag address: AT%MX0.0.

AODB

ARRAY OF ST_IEC870_5_101AODBEntry (STRUCT)

Application object database. It's an array variable. An array element is required for each data point.

F_iecInitAOEntry

STRUCT

In the initialization step, the individual data points of the station are configured once with this function call.