Download: Central station (master)

Simple central station application that uses the TwinCAT IEC 60870-5-102 low-level interface. This sample application can communicate with up to three substations via an RS232 interface. However, in the program only the communication to the first substation is activated.

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

In the sample project, the following station parameters are set for 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).

aClients

ARRAY OF FB_IEC870_5_102M (FB)

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

fbServices

FB_IEC870_5_102MServices ( FB)

Includes a simple implementation of some services such as reading the manufacturer/product specification, retrieving the list of single points, etc.

aProcData

ARRAY OF ST_IEC870_5_102MProcData (STRUCT)

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

sysPara

ST_IEC870_5_102MSysPara (STRUCT)

Configuration of the system parameters of the central station and the implemented services.

fbLog

FB_IEC870_DebugLogFifo (FB)

A simple log buffer for debugging/troubleshooting purposes.