ST_IEC870_5_101SystemParams

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;

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

    dbgMode           : DWORD := 0; (* 0 => disabled,
                Bit 0 set => IEC870_DEBUGMODE_ASDU => debug asdu's, 
                Bit 1 set => IEC870_DEBUGMODE_DEVSTATE => debug device state changes
                Bit 2 set => IEC870_DEBUGMODE_LINKLAYER => link layer frame data *)
    orgAddr           : BYTE := 1; (* Oiginator address, reserved, not used *)

    bOverwrite      : BOOL := FALSE;(* TRUE = Overwrite oldest entries, FALSE = don't overwrite *)
END_STRUCT
END_TYPEEND_TYPE

asduAddr: Common ASDU address in standard direction. Default: 11.

asduAddrRev: Common ASDU address in reverse direction. Default: 22.

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

bEndOfInit: If TRUE, send M_EI_NA_1 (End of init) after station initialisation is completed. Station initialisation is carried out during system start-up or after a process reset. Default: TRUE.

bSyncTime: If TRUE, enable IEC system time synchronization after reception of C_CS_NA_1 command. Default: TRUE.

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

bUsePCTime: If TRUE, synchronise the IEC system time with the system time of the PC. After the initialisation of the substation, the IEC system time is first synchronised with the system time of the TwinCAT PC. Default: TRUE.

tSyncToPCTime: Controls the cyclic synchronisation of the IEC system itme with the system time of the TwinCAT PC. Implemented in IEC870-5-104 slave v3.0.3 and higher. The cyclic synchronisation is deactivated if tSyncToPCTime = T#0s . Default: T#0s.

sPCTimeNetID: TwinCAT network address of the PC whose system time is to be used for the synchronisation. For the local PC an empty string may be specified. Default: empty stirng = local PC.

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

tSyncTimeout: Clock time synchronsation intervall timeout monitoring. Implemented in IEC870-5-101/104 slave libraries v2.0.0 and higher. Earlier versions don´t use this parameter. The time stamps have a IV-Quality-Flag (invalid). For value <> T#0m (eg. T#60m) the IV-Quality-Flag is set invalid for all following time stamps if during one hour the  Clock time synchronsation has not been executed. The IV-Quality-Flag of the time stamp can be used by the master as indicator for the quality of the time stamp. If tSyncTimeout = T#0m  the monitoring is not active . Default: T#0s.

bACTCONRes: If TRUE, send ACTCON response.

bACTTERMRes: If TRUE, send ACTTERM response.

bPerCyclic: If TRUE, enable cyclic/ periodic data transfer 

tPerCyclicBase: Base time of cyclic/ periodic data transfer 

bBackScan: If TRUE, enable back scan.

tBackScanCycle:  Cycle time for back scan.

bPerFRZ: If TRUE, activate local re-storing/resetting of the counter values.

tPerFRZCycle: Cycle time for local re-storing/resetting.

tSelExecTimeout: Max. select/execute time (control station only).

tActConTimeout: Max. activation confirmation time (control station only).

tActTermTimeout: Max. activation termination time (control station only).

tDeactConTimeout: Max. deactivation confirmation time (control station only).

tReadResTimeout: Max. Read response time (control station only).

dbgMode:Debug flags.

Value

Description

IEC870_DEBUGMODE_DISABLED

Log disabled

IEC870_DEBUGMODE_ASDU

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

IEC870_DEBUGMODE_DEVSTATE

Changes in station status are logged in the application log.

IEC870_DEBUGMODE_LINKLAYER

Link layer frames are logged in the application log

IEC870-5-101 slave library: all versions
IEC870-5-104 slave library: v2.0.0 and higher

IEC870_DEBUGMODE_LINKERROR

Link layer errors are logged in the application log

The flags can be ORed in the desired combination.

orgAddr: Source address  (not used).

bOverwrite: Implemented from IEC870-5-104 slave library  v3.0.14 and higher. 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).

 

 

Requirements

Development Environment

Target System

PLC libraries to include

TwinCAT v2.9.0 Build >= 1030

PC or CX (x86)

TcIEC870_5_101.Lib

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

TwinCAT v2.10.0 Build >= 1301

CX (ARM)