ST_IEC870_5_103TBuffer

This data structure (TX/RX data buffer) is used for the data exchange via the IEC 60870-5-103 low-level interface.

Syntax

TYPE ST_IEC870_5_103TBuffer :
STRUCT
    eDbg    : E_IEC870_5_101FifoDbgFlags :=eIEC870_FIFO_DBG_OFF;
    asduSize: BYTE := 249;
    mode    : DWORD := 0; 
    dataLink: ST_IEC870_5_101DataLink;
END_STRUCT
END_TYPE

eDbg: Debugging output parameter.

asduSize: Maximum byte length of the ASDU.

mode: Reserved; currently not used. This value should be null.

dataLink: The elements of this data structure should not be accessed directly, but only with an instance of the FB_IEC870_5_103TBufferCtrl function block.

Internally, the TX/RX data buffer uses two transmit FIFOs and one receive FIFO:

  1. Class 1 transmit FIFO with (high-priority) data;
  2. Class 2 transmit FIFO with (low-priority) data;
  3. Receive FIFO (for Class 1 and Class 2 data);

The lower transport function of the library first empty the Class 1 FIFO, then the Class 2 FIFO. The Class 2 data can only be sent if the Class 1 FIFO contains no data to be sent.

Each of the internal FIFOs has a fixed size of 200000 bytes. Experience shows that each FIFO can hold approx. 2000 ASDUs with one information element (object) with the maximum size or approx. 600 ASDUs with a sequence of 100 information elements (objects).

If a larger number of transmit or receive frames is to be cached (e.g. >2000), external buffers/FIFOs specified by the PLC programmer can be used. At runtime, the PLC application can then top up the TwinCAT transmit FIFO with its own FIFO entries or empty the TwinCAT receive FIFO, if many frames are received. Another possibility is to use two buffers, for example, and alternately fill/read them and transfer the content to the communication block.

Requirements

Development environment

Target system type

PLC libraries to be linked (category group)

TwinCAT v3.1.4012.0

PC oder CX (x86, x64, ARM)

Tc2_IEC60870_5_10x (Communication->IEC60870)
Tc2_SerialCom (Communication->Serial)
Tc2_TcpIp (Communication->TcpIp)
Tc2_Utilities (System)