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
ExecuteBOOLFALSE
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
DoneBOOLFALSE
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
BusyBOOLFALSE
Operation is running (while outputs Done and Error are FALSE)
AbbETrig2
ErrorBOOLFALSE
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
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: