ST_IEC870_5_101Stream

Variables of this type are used as data buffer (stream). "Raw" data bytes cached in the stream in the order in which they are to be sent later or in which they were received. The null data byte is always sent or received first.

Syntax

TYPE ST_IEC870_5_101Stream :
STRUCT
    length  : DWORD := 0;
    data    : ARRAY[0..IEC870_MAX_ASDU_DATA_BYTE] OF BYTE;
END_STRUCT
END_TYPE

length: Current number of data bytes in the stream.

data: Data buffer (byte array).

Memory representation of a stream variable with a cached DWORD variables with the value: 16#BECF1234. Note the interchanged data bytes in the Intel format!

length

data

4

16#34

16#12

16#CF

16#BE

...

...

...

...

...

...

...

IEC870_MAX_ASDU_DATA_BYTE

Use the functions listed in the table to change the memory content of a stream variable:

Function

Description

F_iecResetStream

Stream initialization/reset.

F_iecCopyBufferToStream

Copies data bytes from an external buffer variable to the stream. The memory content of the stream variable is increased.

F_iecCopyBufferToStreamByOffset

Copies data bytes from an external buffer variable to the stream from a byte offset. The memory content of the stream variable is increased.

F_iecCopyStreamToBuffer

Copies data bytes from the stream to an external buffer variable. The memory content of the stream variable remains unchanged.

F_iecCopyStreamToBufferByOffset

Copies data bytes from stream to an external buffer variable from a byte offset. The memory content of the stream variable remains unchanged.

F_iecCopyStreamToStream

Copies data bytes from one stream to another stream. The memory content of the source variable remains unchanged. The memory content of the target variable is increased.

F_iecMoveStreamToBuffer

Copies data bytes from the stream to an external buffer variable and then deletes the copied data bytes from the stream. The memory content of the stream variable is reduced.

F_iecMoveStreamToStream

Copies data bytes from the source stream to the target stream and then deletes the copied data bytes from the source stream. The memory content of the source variable is reduced, the content of the target variable is increased.

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)