History DB - Compression of archives
Because of the archive structure (see Create and configure archives), the use of memory space of archives with different data rate of DPEs in an archive is not optimized.
Considerably more memory space is occupied on the hard disk than would be necessary for the amount of the entries. For this situation, WinCC OA offers the possibility to compress archives. Before reading this chapter, work through the introduction and the previous chapters for acquiring the details about the History DB (see History DB, basics).
The default specification for file compression under Windows is set to FALSE by default (see also config entry compressValueArchive in the chapter Swap out and backup archives). If the config entry however is set to TRUE, this function will be used. When using the automatic compression of a completed archive record, the Windows compression will be executed only after the archive record compression. It is recommended to only use the History DB compression.
Initialization of the compression can be executed either automatically (configurable n seconds after a file change) or manually (button in the Activity panel for the specific archive).
The compression will be activated only for already completed archive records.
The following figure shows a typical data matrix as it can occur in an archive record. It illustrates the functionality of archive compression that is described later in this chapter.
Order of compression
The compression process takes place in two levels:
-
Level 1: All archive records with compression level less than 1 and located on the disk (except the current archive record), see also figure in the chapter Create and configure archives) will be compressed. The compression in level 1 is used to save space for correction values in the archive. Correction values change existing values (for example, faulty measured values) or add new values to the history. (For details on correction values, see chapter Basic information on correction values and laboratory values).
-
Level 2: All archive records compressed already in level 1 (except the current archive record), reduced by the number of archive records that shall stay in compression level 1, will be compressed. The compression in level 2 reduces the memory space of the entire archive. With this action also the value entries released in level 1 are deleted.
Archives with compression level 2 are read only, i.e.: correction values can not be added to archives with compression level 2 anymore.
When the compression is invoked automatically, all compression levels will be executed. While compressing in level 1, a specific number of value entries for each DPE is kept free. The number of free value entries is calculated for each DPE individually.
The available parameters are number and percentage dependent on the values written so far (fill level). When using both parameters, the following rule applies:
The maximum is the valid value (percentage of the values written so far of the fixed amount of values). For example, 5% and ten values means that 5% of already written values will be released provided this is at least ten entries.
The value entries released in the level 1 are deleted via the compression in level 2. Thus, the archive record is compressed completely. After this compression in level 2, the correction values can not be written to the archive anymore.
Config entry
The following config entry in the [valarch] section of the config file can be set to configure the compression:
[valarch]
maxNumberOfFilesToCompress = 10 # Default value is 5
The entry maxNumberOfFilesToCompress defines how many files per archive can be compressed at the same time (during one procedure). This is useful especially when you use the compression for the first time in existing projects since an undefined number of archive sets is available here. The range for this entry is from 3 to 25.
Links to particular chapters of the History DB
In the following table, you can find links to particular chapters of the History DB where you can find more information about compression configuration.
Link | Description |
---|---|
Panel History data base configuration - Size tab | Here you define the number of value entries that should be kept free per DPE during the compression in the level 1 (definition in percent and fixed number). |
Panel History data base configuration - Time tab | Activation of the "automatic compression" option after an archive record change in level 1 and level 2. Definition of the number of the archive sets that should remain in the level 1. |
Panel History data base configuration - Special options tab | Definition of how many seconds after an archive record change the compression will be started. |
Panel History data base activity - Host 1 tab | Overview of current, completed and already compressed archive records. Manual initialization of compression for the current archive. |
Config entry compressValueArchive | The standard for file compression under Windows. |
Details about the History DB - Compression/Decompression of archive records | Detailed information about compression of archive records; Description of the internal data points used. |