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

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: