Quick Start

Simple projects including complete sources is to be found here: IEC60870-5-101 substation.

Interoperability list is to be found here: Interoperability check list

Overview of error codes is to be found here: Error codes

A detailed instruction about implementing the substation within the PLC is to be found here: TUTORIAL

Brief instruction

  1. Create a new PLC project and link the PLC library TcIEC870_5_101Slave.Lib.
  2. Apply two PLC tasks, one fast (e.g. with T#1ms cycle time) and one slow (e.g. with T#1ms cycle time).
    Apply two function blocks (e.g. P_SerialComm_HighSpeed and P_MAIN_LowSpeed ). P_SerialComm_HighSpeed is called by the fast and P_MAIN_LowSpeed is called by the slow task.
  3. Apply an instance of the function block FB_IEC870_SerialLineCtrl at P_SerialComm_HighSpeed, configure it and call it.
    In case of communication via Beckhoff's serial bus terminals or the serial interface of the PC, apply the buffers KL6inData5B, KL6outData5B or PcComInData, PcComOutData and link with the according IO process data at the TwinCAT System Manager.
  4. The instance of the T_HSERIALCTRL variable is used for exchanging Tx/Rx telegrams between both tasks (programs). Apply this variable for example as a global variable.
  5. Configuration of data points: Apply an array variable of ST_IEC870_5_101AODBEntry type. Every array element corresponds to a data point. Configure the data points via the function F_iecInitAOEntry at runtime (e.g. at an init step).
  6. Apply an instance of the des protocol block FB_IEC870_5_101Slave at the P_MAIN_LowSpeed, configure it and call it.
  7. The system and protocol parameter are to be configured according to the parameter of the control station.