Documentation
AC_GetCompaction
Require: Symcon >= 6.3
array AC_GetCompaction (int $InstanceID, int $VariableID)
Parameters
| InstanceID | ID for the archive |
| VariableID | ID of the variable to be queried |
Returns
An array containing the compaction entries of the variable.
Each entry contains the following fields:
| Field | Type | Description |
|---|---|---|
| MonthOffset | int | Month offset for the compaction |
| CompactionType | int | Type of compaction (see below) |
Compaction Types
| CompactionType | Description |
|---|---|
| 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 |
Description
This function queries the compaction entries of the variable with the ID VariableID and returns them as an array. Each entry in the array represents a configured compaction with the corresponding month offset and compaction type.
Example
// Query the compaction entries for "TestVariable"
$compaction = AC_GetCompaction(39147 /*[Archive]*/, 53716 /*[TestVariable]*/);
print_r($compaction);
/* Sample output:
Array
(
[0] => Array
(
[MonthOffset] => -1
[CompactionType] => 1
)
[1] => Array
(
[MonthOffset] => 3
[CompactionType] => 2
)
)
*/