Aggregation functions in combination with the "The value is aggregated" function:

Description

For each variable and thus for each aggregation function, you can activate the "The value is aggregated" function:

"The value is aggregated" = not activated

"The value is aggregated" = activated

When the "The value is aggregated" function is not activated, actual values are transferred to MindSphere every 10 minutes, for example. The respective actual value is valid for 10 minutes until the next actual value is transferred to MindSphere. If the time of the last reading operation is identical to the end of the specified period, the last value is not read.

When the "The value is aggregated" function is activated, no actual values are transferred but the value that has already been calculated or processed in the last 10 minutes is transferred to MindSphere.

Application example:

A temperature measured value is recorded in the plant every minute, and an average value of the recorded values is then transferred to MindSphere every 10 minutes.

Result:

Different results are calculated for the same time range, depending on the initial situation of how you want to collect data.

Only the values marked in green are taken into account for the calculation of the result.

"Counter" aggregation function

"The value is aggregated" = not activated

"The value is aggregated" = activated

131524505227.png
131524666507.png

Calculation example:

The calculation period is from 00:10 to 00:50.

Result: 1 + 1 + 1 + 1 = 4

Calculation example:

The calculation period is from 00:10 to 00:50.

Result: 1 + 1 + 1 + 1 = 4

"Timer" aggregation function

The timer calculates the time interval in which the variable was not "0". Unit = milliseconds.

For the timer, the "The value is aggregated" function is always = False.

132363741963.png

Calculation example:

The calculation period is from 00:00 to 01:00.

Result: 10 Min + 10 Min + 10 Min = 30 Min => 30 * 60 * 1000 ms => 1,800,000 ms

"Average" aggregation function

"The value is aggregated" = not activated

"The value is aggregated" = activated

131524674187.png
131524985099.png

Calculation example:

The calculation period is from 00:10 to 00:50.

(10 + 20 + 30 + 40) / 40 = 2.5 (average value across the calculation period)

Calculation example:

The calculation period is from 00:10 to 00:50.

(20 + 30 + 40 + 50) / 40 = 3.5 (average value across the calculation period)

The aggregation function determines the weighted average depending on the time interval (every 10 minutes). If the time interval changes within a period, e.g. from 10 minutes to 12 minutes, then the values with the time interval 10 minutes are first added and divided by the number of read values. The values are then added together with the time interval 12 minutes and divided by the number of values read. The weighted average is formed from the two results of the two time intervals (result1 + result2)/2=x.

"Min", "Max" and "Last" aggregation functions

"The value is aggregated" = not activated

"The value is aggregated" = activated

131525214347.png
131525218059.png

Calculation example:

The calculation period is from 00:10 to 00:50.

Min: 1

Max: 4

Load: 4

Calculation example:

The calculation period is from 00:10 to 00:50.

Min: 2

Max: 5

Load: 5

"Sum" aggregation function

"The value is aggregated" = not activated

"The value is aggregated" = activated

131525472907.png
131525476619.png

Calculation example:

The calculation period is from 00:10 to 00:50.

1 + 2 + 3 + 4 = 10

Calculation example:

The calculation period is from 00:10 to 00:50.

2 + 3 + 4 + 5 = 14

"AmountToFlow" aggregation function

"The value is aggregated" = not activated

"The value is aggregated" = activated

131525705867.png
131525709579.png

Calculation example:

The calculation period is from 00:00 to 01:00.

Sum: 0 + 1 + 2 + 3 + 4 + 5 = 15

AmountToFlow: Sum / time in hours = 15 / 1 = 15

Calculation example:

The calculation period is from 00:00 to 01:00.

Sum: 1 + 2 + 3 + 4 + 5 + 6 = 21

AmountToFlow: Sum / time in hours = 21 / 1 = 21

"EnergyToPower" aggregation function

"The value is aggregated" = not activated

"The value is aggregated" = activated

131525862027.png
131525865739.png

Calculation example:

The calculation period is from 00:00 to 01:00.

Sum: 0 + 1 + 2 + 3 + 4 + 5 = 15

AmountToFlow: Sum / time in hours = 15 / 1 = 15

Calculation example:

The calculation period is from 00:30 to 01:00.

Sum: 3 + 4 + 5 = 12

AmountToFlow: Sum / time in hours = 12 / 0.5 = 24

Example of process tags of BOOL data type

This example only applies when the "The value is aggregated" function is not activated:

  • Only the values = "1" are added.

  • Time intervals are only recorded when the new value = "1" (Timer).

  • One value is read every 10 minutes between 10:00 a.m. and 11:00 a.m., i.e. six in total. One value is read every 12 minutes between 11:00 a.m. and 12:00 a.m., i.e. five in total. Because the last reading operation takes place at 12:00 a.m. and the evaluation period also ends at 12:00 a.m, the last value is not read. To evaluate the last value at 12:00 a.m., you must set the end of the evaluation period to at least 12:01 a.m.

    Time

    Sum (BOOL)

    INT

    Timer (BOOL)

    In minutes

    10:00

    1

    1

    1

    + 10

    10:10

    1

    2

    1

    + 10

    10:20

    1

    3

    1

    + 10

    10:30

    1

    4

    1

    + 10

    10:40

    1

    1

    1

    + 10

    10:50

    1

    2

    1

    + 10

    11:00

    0

    0

    0

    11:12

    1

    3

    1

    + 12

    11:24

    1

    4

    1

    + 12

    11:36

    1

    5

    1

    + 12

    11:48

    1

    2

    1

    + 12

    12:00

    1

    0

    1

    + 12

    Result

    10

    27

    108 (1 h 48 min)

    Aggregation function

    Sum

    Sum

    Timer

    Timer

Evaluation:

  • The "Sum" aggregation function returns the result = 10

    All values = "1" between 10:00 a.m. and 11:48 a.m. are added.

  • The "Timer" aggregation function returns the result = 108 minutes (1 hour 48 minutes)

    The sum of all time intervals with the state "1" is recorded. The value "1" is read six times between 10:00 and 10:50, with 10-minute intervals between each read. This results in a sum of 60 minutes. No value is read at 11:00. The value "1" is read four times between 11:12 and 12:00. The time interval is 12 minutes each. This results in a sum of 48 minutes. The total is a sum of 108 minutes or 1 hour 48 minutes or 6,480,000 milliseconds.