ST_IEC870_5_101ProtocolParams

Protocol parameters of the link layer. The meaning of the parameters differs, depending on the protocol or station type.

Syntax

TYPE ST_IEC870_5_101ProtocolParams :
STRUCT
    eType         : E_IEC870_DEVICE_TYPE       := eIEC870_101_SLAVE;
    eLinkReset    : E_IEC870_5_101LinkReset    := eIEC870_LinkReset_CU;
    linkAddr      : DWORD                      := 1;
    eLinkAddrSize : E_IEC870_5_101LinkAddrSize := eIEC870_LinkAddr_TwoOctets;
    eLinkMode     : E_IEC870_5_101LinkMode     := eIEC870_LinkMode_Unbalanced;
    eFrameType    : E_IEC870_5_101FrameType    := eIEC870_FrameType_FT1_2;
    tRxTimeout    : TIME := T#5s;
    tTxTimeout    : TIME := T#5s;
    bForceC1Res   : BOOL := TRUE;
    bForceC2Res   : BOOL := TRUE;
    tClass1Poll   : TIME := T#200ms; 
    tClass2Poll   : TIME := T#200ms;
    nRetries      : BYTE := 3;    
    tRetry        : TIME := T#100ms;
    tResponse     : TIME := T#1s;
    tTestLink     : TIME := T#5s;
    tPollDFC      : TIME := T#1s;
    FRAMELength   : BYTE(MIN_IEC870_5_101Link_FRAMELEN..MAX_IEC870_5_101Link_FRAMELEN) := MAX_IEC870_5_101Link_FRAMELEN;
    bRetainBuffer : BOOL := FALSE;
    tMaxPollDelay : TIME := T#0s;
    tLinkPollCycle: TIME := T#10s; 
END_STRUCT
END_TYPE

The table below contains notes regarding the configuration. It the values are fixed, the parameter must match the value from the table (not configurable).

Key:

Parameter name

Initialization value

IEC 60870-5-101
controlled station
(slave, unbalanced mode)

IEC 60870-5-101
control station
(master, unbalanced mode)

IEC 60870-5-103
control station
(master, unbalanced mode)

IEC 60870-5-102
control station
(master, unbalanced mode)

Description

 

eType

eIEC870_101_SLAVE

fixed,
eIEC870_101_SLAVE

fixed,
eIEC870_101_MASTER

fixed,
eIEC870_103_MASTER

fixed,
eIEC870_102_MASTER

Configures the protocol and station type.

eLinkReset

eIEC870_LinkReset_CU

N/A

X

X

fixed,
eIEC870_LinkReset_CU

Reset type during initialization of the link layer.

linkAddr

1

Own address

Address of the remote device

Address of the remote device

Address of the remote device

Connection address.

eLinkAddrSize

eIEC870_LinkAddr_TwoOctets

X

X

X

X

Octet size of the connection address.

eLinkMode

eIEC870_LinkMode_Unbalanced

fixed, eIEC870_LinkMode_Unbalanced

fixed, eIEC870_LinkMode_Unbalanced

fixed, eIEC870_LinkMode_Unbalanced

fixed, eIEC870_LinkMode_Unbalanced

Connection mode (balanced/unbalanced).

eFrameType

eIEC870_FrameType_FT1_2

fixed,
eIEC870_FrameType_FT1_2

fixed,
eIEC870_FrameType_FT1_2

fixed,
eIEC870_FrameType_FT1_2

fixed,
eIEC870_FrameType_FT1_2

 

Telegram frame format. Currently only the format F1.2 is supported.

tRxTimeout

T#5s

X

X

X

X

Max. frame receive timeout time.

tTxTimeout

T#5s

X

X

X

X

Max. frame send timeout time.

bForceC1Res

TRUE

X

N/A

N/A

N/A

If this parameter is set (TRUE), Class 1 data are sent as response to a Class 2 request, if Class 1 data are available (optimized, higher data throughput for Class 1).

 

If this parameter is not set (FALSE), a negative response is sent to a Class 2 request, if Class 1 data are present (lower data throughput, empty telegrams).

bForceC2Res

TRUE

X

N/A

N/A

N/A

If this parameter is set (TRUE), Class 2 data are sent as response to a Class 2 request, even if Class 1 data are available (optimized, higher data throughput for Class 2).

 

If this parameter is not set (FALSE), a negative response is sent to a Class 2 request, if Class 1 data are present (lower data throughput, empty telegrams)

tClass1Poll

T#200ms

N/A

X

X

X

Cycle time in which the Class 1 data are to be queried (unbalanced mode only).

tClass2Poll

T#200ms

N/A

X

X

X

Cycle time in which the Class 2 data are to be queried (unbalanced mode only).

nRetries

3

Not used up to v3.0.6 (error on first disturbed frame),
configurable from v3.0.8 or higher

X

X

X

Maximum number of telegram retries when the data exchange fails.

tRetry

T#100ms

N/A

X

X

X

Delay time for telegram retries when the data exchange fails.

tResponse

T#1s

N/A

X

X

X

This parameter determines the maximum delay time for a telegram acknowledgement. If this time is exceeded, the telegram is repeated up to nRetry times.

tTestLink

T#5s

N/A

N/A

N/A

N/A

Cycle time in which the test telegrams are to be sent (balanced mode only)

tPollDFC

T#1s

N/A

X

X

X

Cycle time in which the connection status is to be queried, if the DFC bit is set. The DFC bit is set by the remote device if further telegrams could cause an overflow.

FRAMELength

MAX_IEC870_5_101Link_FRAMELEN

X

X

X

X

Telegram length, max. length L.

bRetainBuffer

FALSE

from product version v3.0.2 or higher

X

X

X

If this parameter is set, the internal TX/RX buffers are not reset (deleted) on initialization of the link layer.

tMaxPollDelay

T#0s ( = 0: deactivated, <> 0: active)

from product version v3.0.2 or higher

N/A

N/A

N/A

The connection status is declared OFFLINE, when this time is exceeded in the absence of poll queries.

tLinkPollCycle

T#10s

N/A

X

X

X

Cycle time in which link status telegrams are sent to the substation if there is no connection.

Additional information for bForceC1Res and bForceC2Res parameters:

Irrespective whether you set both parameters, one of them or none of them, the ACD bit is set accordingly in order to notify the control station whether Class 1 or Class 2 data should be queried next. These parameters only influence the behavior of the substation for Class 2 interrogations.

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)