ST_IEC870_5_101ProtocolParams

Link layer protocol parameters. The meaning of every parameter depends on protocol or device type.

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 lower table shows the different device type parameter configuration. Fixed values can not be configured.

 

Legend:

Parameter name

Init/default  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 value,
eIEC870_101_SLAVE

fixed value,
eIEC870_101_MASTER

fixed value, eIEC870_103_MASTER

fixed value, eIEC870_102_MASTER

Configures the protocol and device type.

eLinkReset

eIEC870_LinkReset_CU

N/A

X

X

fixed value, eIEC870_LinkReset_CU

Configures the link layer (initialization) reset type.

linkAddr

1

own address

address of remote communication unit

address of remote communication unit

address of remote communication unit

Link address.

eLinkAddrSize

eIEC870_LinkAddr_TwoOctets

X

X

X

X

Link adress octet size.

eLinkMode

eIEC870_LinkMode_Unbalanced

fixed value, eIEC870_LinkMode_Unbalanced

fixed value, eIEC870_LinkMode_Unbalanced

fixed value, eIEC870_LinkMode_Unbalanced

fixed value,
eIEC870_LinkMode_Unbalanced

Link mode (balanced/unbalanced).

eFrameType

eIEC870_FrameType_FT1_2

fixed value, eIEC870_FrameType_FT1_2

fixed value, eIEC870_FrameType_FT1_2

fixed value, eIEC870_FrameType_FT1_2

fixed value, eIEC870_FrameType_FT1_2

Telegramm frame format. Only F1.2 is supported.

tRxTimeout

T#5s

X

X

X

X

Max. frame receive timeout time. This parameter specifies the time to wait until frame is received before a timeout condition is set.
If the timeout condition is set, all bytes in the frame received will be discarded.

tTxTimeout

T#5s

X

X

X

X

Max. frame send timeout time.This parameter specifies the time to wait until frame is send before a timeout condition is set.

bForceC1Res

TRUE

X

N/A

N/A

N/A

If set (TRUE), in response to a class 2 poll, a controlled station may respond with class 1 data when there is class 1 data available (optimized, higher class 1 data throughput).


If not set (FALSE), in response to class 2 poll, a controlled station may respond with NOUSERDATA when there is class 1 data available (empty telegramms).

bForceC2Res

TRUE

X

N/A

N/A

N/A

If set (TRUE), in response to a class 2 poll, a controlled station may respond with class 2 data even tough class 1 data is available (optimized, higher class 2 data throughput).


If not set (FALSE), in response to class 2 poll, a controlled station may respond with NOUSERDATA even tough  class 1 data is available (empty telegramms).

tClass1Poll

T#200ms

N/A

X

X

X

How often to check for class 1 data (unbalanced mode only).

tClass2Poll

T#200ms

N/A

X

X

X

How often to check for class 2 data. If the RTU has class 1 data, this is shown in the response to the poll for class 2 data, in this case the device will automatically poll for class 1 data (unbalanced mode only).

nRetries

3

Not used in v3.0.6 and lower(error after first disturbed frame),

configurable in v3.0.8 and higher

X

X

X

This parameter specifies the number of retries (0 to 255) if a response is not received.

tRetry

T#100ms

N/A

X

X

X

Repeated frames delay time.

tResponse

T#1s

N/A

X

X

X

This parameter specifies the time to wait for a response to a primary message. If the timeout is recognized, the message will be retransmitted up to the number of times specified in the nRetries parameter.

tTestLink

T#5s

N/A

N/A

N/A

N/A

How often to send test link messages. Note that this has effect only for balanced mode, because test link messages are undefined in unbalanced mode and will not be sent.

tPollDFC

T#1s

N/A

X

X

X

How often to read link status if DFC bit is set. Remote communication unit sets the DFC bit if further messages may cause data overflow.

FRAMELength

MAX_IEC870_5_101Link_FRAMELEN

X

X

X

X

Max. frame length L.

bRetainBuffer

FALSE

available from product version v3.0.2 and higher

X

X

X

The internal TX/RX buffer are reset (cleared) during the initialisation of the link layer if this parameter is set.

tMaxPollDelay

T#0s (= 0: not used, <> 0: used

available from product version  v3.0.2 and higher

N/A

N/A

N/A

Max. time between link polls before station is declared OFFLINE.

tLinkPollCycle

T#10s

N/A

X

X

X

How often to read link status if the connection is offline.

 

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 behaviour of the substation for Class 2 queries.

 

 

Requirements

Development Environment

Target System

PLC libraries to include

TwinCAT v2.9.0 Build >= 1030

PC or CX (x86)

TcIEC870_5_101Link.Lib

( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib; TcIEC870_5_101.Lib; COMlibV2.Lib; are included automatically )

TwinCAT v2.10.0 Build >= 1301

CX (ARM)