ST_IEC870_5_101SystemParams

System parameters of the station.

Syntax

TYPE ST_IEC870_5_101SystemParams :
STRUCT
    asduAddr        : DWORD := 11;
    asduAddrRev     : DWORD := 22;

    asduFmt         : ST_IEC870_5_101AsduFmtParams := ( eCOTSize := eIEC870_COT_TwoOctets,
                                                        eAsduAddrSize := eIEC870_AsduAddr_TwoOctets,
                                                        eObjAddrSize := eIEC870_ObjAddr_ThreeOctets );
    bEndOfInit      : BOOL := TRUE;

    bSyncTime       : BOOL := TRUE;
    bSyncPCTime     : BOOL := FALSE;

    bUsePCTime      : BOOL := TRUE;
    tSyncToPCTime   : TIME := T#0s;
    sPCTimeNetID    : T_AmsNetID := '';

    bTimeCOT3       : BOOL := FALSE;
    tSyncTimeut     : TIME := T#0m;

    bACTCONRes      : BOOL := TRUE;
    bACTTERMRes     : BOOL := TRUE;

    bPerCyclic      : BOOL := FALSE;
    tPerCyclicBase  : TIME := T#60s; 

    bBackScan       : BOOL := FALSE;
    tBackScanCycle  : TIME := T#60s;

    bPerFRZ         : BOOL := FALSE;
    tPerFRZCycle    : TIME := T#60s;
    bSyncPerFRZtoHour : BOOL := FALSE;

    tSelExecTimeout : TIME := T#10s;
    tActConTimeout  : TIME := T#5s;
    tActTermTimeout : TIME := T#30s;
    tDeactConTimeout: TIME := T#5s;
    tReadResTimeout : TIME := T#5s;

    dbgMode         : DWORD := 0;
    orgAddr         : BYTE := 1;

    bOverwrite      : BOOL := FALSE;
    bCBOActTerm     : BOOL := FALSE;
    bAdoptSuccTSC   : BOOL := FALSE;
END_STRUCT
END_TYPE

asduAddr: Common ASDU address (CAA) in standard direction. Default: 11.

asduAddrRev: Common ASDU address (CAA) in reverse direction. Default: 22.

asduFmt: ASDU format parameter (e.g. octet length of the cause of transfer, ASDU address and object address);

bEndOfInit: If TRUE, send M_EI_NA_1 (end of init) after station initialization is completed. A station initialization is performed during a system startup or after a process reset. Default: TRUE.

bSyncTime: If TRUE, activate IEC system time synchronization on receiving the C_CS_NA_1 command. Default: TRUE.

bSyncPCTime: If TRUE, synchronize the IEC system time and the system time of the TwinCAT PC (the Windows system time in the taskbar). Default: FALSE.

bUsePCTime: If TRUE, synchronize the IEC system time with the system time of the PC. Following the initialization of the substation, the IEC system time is first synchronized with the system time of the TwinCAT PC (Windows system time). Default: TRUE.

tSyncToPCTime : controls the cyclic synchronization of the IEC system time with the system time of the TwinCAT PC (in online and offline mode). Implemented in IEC870-5-104 slave library v3.0.3 and higher.

The time is determined by the cycle time in which the synchronization is executed. A value of T#0s deactivates the cyclic synchronization. Default: T#0s.

sPCTimeNetID: TwinCAT network address of the PC whose system time is to be used for the synchronization. If it is to be run on the local computer, an empty string can be entered. Default: Empty string = local PC.

bTimeCOT3: If TRUE, send the system time to the central station with the cause of transfer <3> spontaneous on the hour. Default: FALSE.

tSyncTimeout: Time synchronization interval timeout monitoring. Implemented in IEC870-5-101/104 slave library v2.0.0 and higher. This parameter is not used in older versions. The timestamps have an IV quality flag (invalid). If the value is <> T#0m (e.g. T#60m), the IV quality flag for all subsequent timestamps is set to invalid, if no time synchronization was performed within one hour. The master can use the IV quality flag of the timestamp as indicator for the quality of the timestamp. Monitoring is not active if tSyncTimeout = T#0m.

bACTCONRes: If TRUE, send ACTCON response.

bACTTERMRes: If TRUE, send ACTTERM response.

bPerCyclic: If TRUE, activate cyclic/periodic data transfer.

tPerCyclicBase: Base time for the cyclic/periodic data transfer.

bBackScan: If TRUE, activate background scan.

tBackScanCycle: Background scan cycle time.

bPerFRZ: If TRUE, activate local freezing/resetting of the counter values.

tPerFRZCycle: Cycle time for local freezing/resetting.

bSyncPerFRZtoHour: Synchronize periodic/cyclic freezing of the counters on the hour. Default: FALSE (deactivated).

tSelExecTimeout: Max. timeout time between the selection command and the execution command (central station only).

tActConTimeout: Max. timeout time for receiving the command activation confirmation (central station only).

tActTermTimeout: Max. timeout time for receiving the command termination (central station only).

tDeactConTimeout: Max. timeout time for receiving the command abortion confirmation (central station only).

tReadResTimeout: Max. timeout time for execution of the read command (C_RD_NA_1) (central station only).

dbgMode: Debug flags:

Value

Description

IEC870_DEBUGMODE_DISABLED

Logging deactivated

IEC870_DEBUGMODE_ASDU

The ASDUs are logged as hexadecimal output in the application log.

IEC870_DEBUGMODE_DEVSTATE

State changes of the station are logged in the application log.

IEC870_DEBUGMODE_LINKLAYER

Link layer frames are logged in the application log

IEC870-5-101 slave library: available for all versions;
IEC870-5-104 slave library: available from v2.0.0 and higher;

IEC870_DEBUGMODE_LINKERROR

Link layer error messages are logged in the application log.

The flags can be OR-linked in the required combination.

orgAddr: Source address (currently not used).

bOverwrite: Activates/deactivates the overwriting of the oldest messages in the send buffer if the max. permissible buffer size is exceeded. This parameter is active only in the offline mode, (i.e. if the connection has been interrupted) and if offline data storage has additionally been activated via the bRetainBuffer parameter in the protocol parameters (ST_IEC870_5_104ProtPara). In online mode (i.e. if data transfer has been started) no older messages are overwritten (otherwise some intermediate values would possibly be missing).

bCBOActTerm : Only for: C_BO_NA_1, C_BO_TA_1, C_BO_TB_1. Used/expected causes of transfer: actTerm, deact, deactCon bit string command. Default: FALSE (do not use).

bAdoptSuccTSC : Only for: C_TS_TA_1: Accept/synchronize received counter value.

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)