Substation Minimal (slave)

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

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

MAIN

PRG

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

fbServer

FB_IEC870_5_104Slave (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

FUNCTION

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