LogFileReduce (FB)
FUNCTION_BLOCK LogFileReduce EXTENDS AbbLConC2
This function block is used to maintain the file ring buffer in the multifile logging.
This function block is only usable in connection with LogMultifile. The function block is depended on outputs FileMoved and MovedFilename of LogMultifile. These outputs to be connected to the homonymous input of the LogFileReduce.
The function block can manage up to 20 file names, beyond that oldest file will be deleted.
- InOut:
Scope
Name
Type
Initial
Comment
Input
FileMovedBOOLFALSE
2: File has been moved with MovedFilename - connect output with the same name in LogMultifile
MovedFilenameSTRING‘’
3: Timestamp file including path: FilePath + filename, connect output with the same name in LogMultifile
ADRbufferFilesPOINTER TO STRING
4: Buffer files array, connect using ADR operator. Array size should be larger than NumFiles configured
NumFilesUDINT0
5: Number of needed filenames in stack. When this number is exceeded, then delete the supernumerary file, maximum 20 files possible
Output
ErrorIDNO_ERROR
3: 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
4: File operation error details, see CAA_File Library for error details
MessagezLOG_IDLE
5: Messages of the processing of the function block, block is not aborted only a detailed message is provided from enumeration LOG_ENUM_STATE
ActualNumFilesUDINT6: Actual number of files in FilePath - please define this as VAR_RETAIN
Methods:
B_CyclicAction
D_AbortAction
E_ResetAction
Structure: