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
FilePathCAA.FILENAME2: FilePath of folder to be deleted. Diskname/FilePath
Inout
TokenUINT3: 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
ErrorIDNO_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
FileErrorFILE.ERRORFILE.ERROR.NO_ERROR
5: File operation error details, see CAA_File Library for error details
MessagezLOG_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
CurrentActionzLOG_IDLE
7: Current action, shows what is currently being processed in the function block, details from Enumeration LOG_ENUM_STATE
ActNumDeletedFilesUDINT0
8: Actual number of found and deleted files in FilePath
HandleDirectoryCAA.HANDLE9: Handle of actual open directory
DirectoryIsOpenedBOOLFALSE
10: Indicate if directory is opened
MyTokenUINT0
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: