F_iecRemoveTableEntry

From product version: TwinCAT PLC Library IEC60870-5-104 controlling station v1.0.0 and higher.

F_iecRemoveTableEntry 1:

The function F_iecRemoveTableEntry removes an hash table entry that matches to the key.

FUNCTION F_iecRemoveTableEntry: UDINT

VAR_INPUT
    key : ST_IEC870_5_101HashTableKey;
END_VAR
VAR_IN_OUT
    hTable  : T_HAODBTable;
ENd_VAR

key: Lookup key.

hTable: Application object data base handle (hash table handle). The table handle has to be initialized once before using with the function F_iecCreateTableHnd.

Return parameter

Description

0

No error. The table entry has been removed successfully.

<> 0

Error: IEC60870-5-10x error code

 

Example in ST:

Three hash table entries will be romoved from the application data base. The searched data points have already been configured as hash table entries.
See description of: F_iecAddTableEntry.

eType

objAddr

asduAddr

group

M_SP_NA_1

100

11

IEC870_GRP_INRO1

M_DP_NA_1

200

11

IEC870_GRP_INROGEN

M_IT_NA_1

800

11

IEC870_GRP_REQCOGEN

PROGRAM P_RemoveEntry
VAR_IN_OUT
    hTable : T_HAODBTable;
END_VAR
VAR
    key : ST_IEC870_5_101HashTableKey;
    bRemove : BOOL;
    nError : UDINT;
END_VAR
IF bRemove THEN
    bRemove         := FALSE;

    key.eType       := M_SP_NA_1;
    key.asduAddr    := 11;
    key.objAddr     := 100;
    key.group       := IEC870_GRP_INRO1;
    key.lookup      := IEC870_LOOKUP_KEY_ALL_ON;
    nError      := F_iecRemoveTableEntry( key := key, hTable := hTable );
    IF nError <> 0 THEN
        RETURN;
    END_IF

    key.eType       := M_DP_NA_1;
    key.asduAddr    := 11;
    key.objAddr     := 200;
    key.group       := IEC870_GRP_INROGEN;
    key.lookup      := IEC870_LOOKUP_KEY_ALL_ON;
    nError      := F_iecRemoveTableEntry( key := key, hTable := hTable );
    IF nError <> 0 THEN
        RETURN;
    END_IF

    key.eType       := M_IT_NA_1;
    key.asduAddr    := 11;
    key.objAddr     := 800;
    key.group       := IEC870_GRP_REQCOGEN;
    key.lookup      := IEC870_LOOKUP_KEY_ALL_ON;
    nError      := F_iecRemoveTableEntry( key := key, hTable := hTable );
    IF nError <> 0 THEN
        RETURN;
    END_IF
END_IF

 

Requirements

Development Environment

Target System

PLC Libraries to include

TwinCAT v2.10.0 Build >= 1301

PC or CX (x86, ARM)

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