F_iecRemoveTableEntry

F_iecRemoveTableEntry 1:

The function F_iecRemoveTableEntry removes a hash table entry matching the key.

Syntax

FUNCTION F_iecRemoveTableEntry: UDINT
VAR_INPUT
    key     : ST_IEC870_5_101HashTableKey;
END_VAR
VAR_IN_OUT
    hTable  : T_HAODBTable;
ENd_VAR

F_iecRemoveTableEntry 2: Inputs

key: Lookup key.

Inputs/outputs

hTable: Application object database handle (hash table handle). The table handle must be initialized once with the function F_iecCreateTableHnd before it can be used.

F_iecRemoveTableEntry 3: Return value

Return parameter

Description

0

No error, the table entry was successfully removed.

<> 0

Error: IEC60870-5-10x error code

Sample in ST

Three hash table entries are removed from the application database. The associated data points have already been configured as hash table entries. See function description: 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 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)