
4. Configuration
203
IF (m_DeleteLogs = TRUE) THEN
eLogError := UserLogDeleteAll();
m_DeleteLogs := FALSE;
// ‘eLogError’ variable will receive possible function errors
END_IF
ATENTION:
The return of the UserLogDeleteAll function does not indicate complete operation, only execution
confirmation, which can take a long time if there are too many log files in the directory. The
function to register new user logs will be unavailable during this time, returning the code
USER_LOG_PROCESSING for any operation. The operation result can also be checked in the
system log.
ClearRtuDiagnostic
The LibRtuStandard library provides the ClearRtuDiagnostic function block, which is used to clear
the diagnoses of Retentivity Loss and Event Queue Overflow. It and can also reset the flag of clean
event queue. As described on Table 4-145, the action that will be executed by this function is
determined by the code of the ENUM assigned to the eDiagnostic input.
Name
ENUM (BYTE)
Description
DIAG_RETENTIVITY_LOST
0
Clears Retentivity Loss diagnostics
DIAG_QUEUE_OVERFLOW
1
Clears Event Queue Overflow diagnostics
DIAG_QUEUE_CLEARED
2
Clears Clean Event Queue diagnostics
Table 4-145. Description of actions of ClearRtuDiagnostic
The next table describes the execution status of the function is presented in its output variable.
Name
ENUM (UDINT)
Description
OK_SUCCESS
0
Operation success.
ERROR_ PARAMETER
3
Parameter error (the value assigned on eDiagnostic input
is out of the valid range)
Table 4-146. Results of ClearRtuDiagnostic
Example in ST, where the function call cleans the DG_HX3040.tSummarized.bRetentivityLost bit of
the CPU diagnostics structure:
PROGRAM StartPrg
VAR
Result : TYPE_RESULT;
END_VAR
Result := ClearRtuDiagnostic(eDiagnostic := 0);
ClearEventQueue
The LibRtuStandard library provides the ClearEventQueue function, which is used to clear both the
CPU Event Queue, and the other instantiated drivers. Table 4-147 indicates that the execution status
of the function is presented in its output variable.
Name
ENUM (UDINT)
Description
OK_SUCCESS
0
Operation success.
ERROR_FAILED
1
Operation failuire.
Table 4-147. ClearEventQueue Description