LogFileDelete (FB)

FUNCTION_BLOCK LogFileDelete EXTENDS AbbETrig2

This function block is used to delete the timestamped log files stores for an instance of the Multi logger.

Based on the filepath input, from the folder all files will be deleted one after another.

Note

Function block LogFileDelete must not be used with function block LogFileReduce enabled which will lead to wrong behavior of LogFileReduce

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

Execute

BOOL

FALSE

A rising edge starts the operation, the output Busy goes to TRUE. In the first cycle all other inputs are read and stored, afterwards they are ignored. A falling edge does not stop the operation. After Done = TRUE or Error = TRUE and Execute = FALSE all outputs will be reset.

AbbETrig2

Output

Done

BOOL

FALSE

Operation is completed without error (while outputs Busy and Error are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE

AbbETrig2

Busy

BOOL

FALSE

Operation is running (while outputs Done and Error are FALSE)

AbbETrig2

Error

BOOL

FALSE

Operation is stopped with error (while outputs Busy and Done are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE. The output ErrorID gives more details about the error.

AbbETrig2

Input

FilePath

CAA.FILENAME

2: FilePath of folder to be deleted. Diskname/FilePath

Inout

Token

UINT

3: Token, is the same variable for all participants of the same type, every function block set it’s participant number in Token, when active

Output

ErrorID

ERROR_ID

NO_ERROR

4: ErrorID is always accompanied by an error and abort of the function block processing, Refer ERROR_ID enumeration for details of the error

FileError

FILE.ERROR

FILE.ERROR.NO_ERROR

5: File operation error details, see CAA_File Library for error details

Message

LOG_ENUM_STATE

zLOG_IDLE

6: Messages of the processing of the function block, block is not aborted only a detailed message is provided from enumeration LOG_ENUM_STATE

CurrentAction

LOG_ENUM_STATE

zLOG_IDLE

7: Current action, shows what is currently being processed in the function block, details from Enumeration LOG_ENUM_STATE

ActNumDeletedFiles

UDINT

0

8: Actual number of found and deleted files in FilePath

HandleDirectory

CAA.HANDLE

9: Handle of actual open directory

DirectoryIsOpened

BOOL

FALSE

10: Indicate if directory is opened

MyToken

UINT

0

11: Token number automatically assigned in first cycle for each function block of the same type, which identifies it in the token ring. This is necessary that several function blocks cannot execute file operations at the same time during CAA file handling, only function block that has token is allowed to do

Methods:

B_CyclicAction

C_CleaningAction

D_ResetAction

Structure: