« Back to Product

Documentation

AC_SetCompaction

Require: IP-Symcon >= 6.3

 boolean AC_SetCompaction (int $InstanceID, int $VariableID, int $MonthOffset, int $CompactionType) 

Parameters

InstanceID

ID for the archive

VariableID

ID of the variable for which the compaction is to be set

MonthOffset

The number of months after which the compaction is applied; 0 = After the current month is ended, -1 = Compact values directly

CompactionType
CompactionType Description
-1 Deactivate compaction
0 Compact to one value per minute
1 Compact to one value per 5 minutes
2 Compact to one value per hour
3 Compact to one value per day
4 Compact to one value per week
5 Compact to one value per month
6 Compact to one value per year
7 Delete values

Returns

True if successful, otherwise False

Description

This function updates the compaction entry of the variable with the ID VariableID and the month offset MonthOffset and sets it to the compaction type CompactionType. Other compaction entries with different month offsets remain unaffected.

Warning

Afterwards a reaggregation of the variable is necessary.

Example

// Set the direct compaction of the variable "TestVariable" to 1 (One value per 5 minutes)
AC_SetCompaction(39147 /*[Archive]*/, 53716 /*[TestVariable]*/, -1, 1);
Any questions?