All values in the PLC can be stored in a statistic. For this purpose, the data is recorded using the function block LOGGER. To display these values on the visualization, the plugin Diagram is used.
The data is sent cyclically from the PLC to the logger service. This then writes the received data into the database. The data always consists of minimum, maximum, and average values. An attempt is made to store the data at a uniform interval so that they can be compared with each other.
When the data is queried on the visualization, it is calculated accordingly. To make the next query faster, the results are cached. The cache can be deleted using Clear Data. Every night, old data is cleared according to the
Retention Policies.
Note: The duration for maximum retention can be set in the context menu under Project
▸ Settings
▸ Automation▸ Retention Policies.
When creating a logger, it is important to set its interval as high as possible. An interval for sunlight of T#15m is completely sufficient. Additionally, the interval can also be changed dynamically to log, for example, the fill level of a container at a faster interval when filling it. The higher the interval, the faster the statistic is calculated.
Note: It is important to convert values into the correct unit. For example, kW should always be converted to W. The SI unit can then be automatically generated upon output.
A counter value must always be absolute. The first entry represents the value 0. The calculation of the data is configured in the plugin
Diagram with Differential - Maximum.
To log binary values, the function block RT_UPTIME can be connected before the input IN. The interval PT of UPTIME_RT should be identical to that of the logger. The calculation of the data is configured in the plugin
Diagram with Differential - Maximum.
To output the logger data, the plugin Diagram is used. Each plugin can display multiple values simultaneously. The colors and names must be configured individually in each plugin. On the visualization, values can be easily hidden.
Note: The logger will only be displayed on the visualization if the permission on the symbol is met.
An overview and management of all generated statistics are available in the context menu under Data Statistics. Additionally, the loggers are displayed in the
Structure under the element where they are located.
To delete a statistic, select the Logger in the
Management and then remove it with
Remove. Click on
Apply to reset all selected statistics. Removed statistics may reappear if the data is written again in the next interval.
When exporting a project, statistics are not backed up. To save them, you must export them separately. They can be exported per project in the context menu under Data
To import the data again, the project must first be imported. The statistic data will be imported to the project with the same ID. Multiple sets of statistic data can be imported on top of each other and then merged.
The so-called self-defense is a protective mechanism. If a buffer overflow occurs in a project, data is deleted and the interval for the loggers is increased. The increase starts from the bottom up until the overflow can be caught. However, this catching method stops at 15 minutes. If too many loggers are used or if SSD damage occurs, this emergency mode will not catch it either. Recovery happens automatically but may take an hour or longer.
IMPORTANT: If the
Self-Defense mode is active, this will be displayed in the bottom right of the system tray. This warning should be taken very seriously as it can lead to data loss since all excess data are simply irretrievably deleted.
The times behind the project name represent the current minimum interval that was applied. To remove the error, the number of loggers should be reduced or the interval increased. Rounding numbers does not help at all as the size of the memory is fixed.