F_iecResetStream

F_iecResetStream 1:

The function initializes and resets the stream variable. Optionally, the internal data buffer of the stream variable can be initialized with a certain number of zero bytes. The return value of the function returns the number of successfully initialized zero bytes.

Syntax

FUNCTION F_iecResetStream: UDINT
VAR_INPUT
    cbLength : UDINT;
END_VAR
VAR_IN_OUT
    stream   : ST_IEC870_5_101Stream;
END_VAR

F_iecResetStream 2: Inputs

cbLength: Number of zero bytes to be initialized.

Inputs/outputs

stream: Buffer variable to be initialized.

Sample in ST

After the program start, the internal buffer of the stream variable is reset and initialized with 5 zero bytes.

PROGRAM P_ResetStream
VAR
    stream : ST_IEC870_5_101Stream;
    bReset : BOOL := TRUE;
END_VAR
IF bReset THEN
    bReset := FALSE;
    F_iecResetStream( 5, stream );
END_IF

Memory content of the stream variable after the program start:

length

data

5

16#00

16#00

16#00

16#00

16#00

...

...

...

...

...

...

IEC870_MAX_ASDU_DATA_BYTE

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)