Delete

This method can be used to delete databases and AutoLog groups from the configuration of the TwinCAT Database Server.

Syntax

METHOD Delete : BOOL
VAR_INPUT
    eTcDBSrvConfigType: E_TcDBSrvConfigType;
    hConfigID: UDINT;
END_VAR

Delete 1: Inputs

Name

Type

Description

eTcDBSrvConfigType

E_TcDBSrvConfigType

Type of the configuration to be deleted (database / AutoLog group)

hConfigID

UDINT

ID of the configuration to be deleted (hDBID or hAutoLogGrpID)

Delete 2: Return value

Name

Type

Description

Delete

BOOL

Displays the status of the method. Returns TRUE as soon as the method execution is finished, even in the event of an error.

Sample

VAR
    fbConfigTcDBSrv : FB_ConfigTcDBSrvEvt(sNetId := '', tTimeout:=T#5S);
    myConfigHandle  : INT;
    tcMessage       : I_TcMessage;
END_VAR
IF fbConfigTcDBSrv.Delete(
    eTcDBSrvConfigType := E_TcDBSrvConfigType.Database,
    hConfigID := myConfigHandle) THEN
IF fbConfigTcDBSrv.bError THEN
        tcMessage := fbConfigTcDBSrv.ipTcResult;
        nState := 255; 
    ELSE
        nState := 0; 
    END_IF    
END_IF