Aggregates coding group
This code group defines all supported aggregates.
Lua access code
To access the code of the codings below, append the coding group name and coding name to syslib.model.codes,
see an example below.
return syslib.model.codes.Aggregates.AGG_TYPE_ANNOTATIONCOUNT
Codings
| Name | Code | Description |
|---|---|---|
| AGG_TYPE_ANNOTATIONCOUNT | 33 | This aggregate returns the number of all annotations in the interval |
| AGG_TYPE_AVERAGE | 2 | This aggregate adds up and the values of all good raw data for each interval and divides the sum by the number of good values and returns this average and the starttime of the interval |
| AGG_TYPE_BESTFIT | 40 | The Bestfit aggregate is a combination of the aggregates Maximum / Minimum Actual Time / Interpolative. If both Max and Min aggregate for an interval returns NoData the interpolative value is used (Non-Stepped trendtype), or the last known good value (Stepped trendtype). It is not part of the OPC UA Specification, and optimized for drawing trends |
| AGG_TYPE_COUNT | 17 | This aggregate retrieves the count of good raw values |
| AGG_TYPE_DELTA | 23 | This aggregate retrieves the difference between the earliest and latest good raw values in the interval |
| AGG_TYPE_DELTABOUNDS | 26 | This aggregate returns the difference between a good startbound and a good endbound aggregate |
| AGG_TYPE_DURATIONBAD | 28 | This aggregate divides the interval into regions of bad and non-bad data. Each region starts with a data point in the interval. If that data point is bad the region is bad. The returned value is the sum of the duration of all bad regions expressed in milliseconds. The status of the first region is determined by finding the first data point at or before the start of the interval. If no value exists the first region is bad. The timestamp returned is the starttime |
| AGG_TYPE_DURATIONGOOD | 27 | This aggregate divides the interval into regions of good and non-good data. Each region starts with a data point in the interval. If that data point is good the region is good. The returned value is the sum of the duration of all good regions expressed in milliseconds. The status of the first region is determined by finding the first data point at or before the start of the interval. If no value exists the first region is bad. The timestamp returned is the starttime |
| AGG_TYPE_DURATIONINSTATENONZERO | 19 | This aggregate returns the time in milliseconds during the good raw values (including the simple bounding values) in the interval are not in zero state |
| AGG_TYPE_DURATIONINSTATEZERO | 18 | This aggregate returns the time in milliseconds during the good raw values (including the simple bounding values) in the interval are in zero state |
| AGG_TYPE_END | 22 | This aggregate retrieves the latest raw value within the interval and returns that value and status with the timestamp at which that value occurs |
| AGG_TYPE_ENDBOUND | 25 | This aggregate returns the value and status at the endtime for the interval by calculating the simple bounding value for the interval. The timestamp returned is the starttime |
| AGG_TYPE_INTERPOLATIVE | 1 | This aggregate returns the interpolated bounding value for the StartTime of each interval |
| AGG_TYPE_INTERPOLATIVE_END | 38 | This aggregate returns the interpolated bounding value for the EndTime of each interval |
| AGG_TYPE_INVALID | 0 | Invalid |
| AGG_TYPE_MAXIMUM | 8 | This aggregate finds the maximum value of all good raw values and returns this value with the starttime of the interval. If multiple extremevalues exist the status 'multiple values' is set |
| AGG_TYPE_MAXIMUM2 | 13 | This aggregate includes the simple bounding values to identify the extremevalue and returns this value with the starttime of the interval. If multiple extremevalues exist the status 'multiple values' is set |
| AGG_TYPE_MAXIMUMACTUALTIME | 10 | This aggregate detects the maximum value of all good raw values and returns this value with the timestamp at which that value occurs. If multiple extremevalues exist the oldest one is retrieved and the status 'multiple values' is set |
| AGG_TYPE_MAXIMUMACTUALTIME2 | 15 | This aggregate includes the simple bounding values to identify the extremevalue and returns this value with the timestamp at which that value occurs. If multiple extremevalues exist the oldest one is retrieved and the status 'multiple values' is set |
| AGG_TYPE_MINIMUM | 7 | This aggregate finds the minimum value of all good raw values and returns this value with the starttime of the interval. If multiple extremevalues exist the status 'multiple values' is set |
| AGG_TYPE_MINIMUM2 | 12 | This aggregate includes the simple bounding values to identify the extremevalue and returns this value with the starttime of the interval. If multiple extremevalues exist the status 'multiple values' is set |
| AGG_TYPE_MINIMUMACTUALTIME | 9 | This aggregate detects the minimum value of all good raw values and returns this value with the timestamp at which that value occurs. If multiple extremevalues exist the oldest one is retrieved and the status 'multiple values' is set |
| AGG_TYPE_MINIMUMACTUALTIME2 | 14 | This aggregate includes the simple bounding values to identify the extremevalue and returns this value with the timestamp at which that value occurs. If multiple extremevalues exist the oldest one is retrieved and the status 'multiple values' is set |
| AGG_TYPE_NUMBEROFTRANSITIONS | 20 | This aggregate returns the number of good raw value transitions during the interval. The earliest transition must be calculated by comparing the earliest non-bad value in the interval to the previous non-bad value. A transition occurred if no previous non-bad value exists or if the earliest non-bad value is different. The endtime is not included |
| AGG_TYPE_PERCENTBAD | 30 | This aggregate calculates the DurationBad divided by the interval multiplied by 100. (DurationBad / Interval * 100) |
| AGG_TYPE_PERCENTGOOD | 29 | This aggregate calculates the DurationGood divided by the interval multiplied by 100. (DurationGood / Interval * 100) |
| AGG_TYPE_RANGE | 11 | This aggregate calculates the difference between the maximum and the minimum of all good raw values and returns the starttime of the interval. If only one good value exists the range is zero, otherwise it is always positive |
| AGG_TYPE_RANGE2 | 16 | This aggregate returns the difference between the Maximum2 and the Minimum2 aggregates. If only one good value exists the range is zero, otherwise it is always positive |
| AGG_TYPE_RAW | 41 | Receive raw data - as stored in the historian database |
| AGG_TYPE_SAMPLE | 39 | The Sample aggregate is a combination of the aggregates Maximum / Minimum Actual Time. It is not part of the OPC UA Specification, and optimized for drawing trends |
| AGG_TYPE_STANDARDDEVIATIONPOPULATION | 36 | This aggregate calculates the 'standard deviation population' of the good raw values in the interval. If there is only 1 good raw value 0 is returned. The timestamp returned is the starttime |
| AGG_TYPE_STANDARDDEVIATIONSAMPLE | 34 | This aggregate calculates the 'standard deviation sample' of the good raw values in the interval. If there is only 1 good raw value 0 is returned. The timestamp returned is the starttime |
| AGG_TYPE_START | 21 | This aggregate retrieves the earliest raw value within the interval and returns that value and status with the timestamp at which that value occurs |
| AGG_TYPE_STARTBOUND | 24 | This aggregate returns the value and status at the starttime for the interval by calculating the simple bounding value for the interval |
| AGG_TYPE_TIMEAVERAGE | 3 | This aggregate calculates the area under a sloped line which connects the interpolative start value, all good raw values and the interpolated bounding value at the end and divides this area by the length of the processing interval. It returns the time weighted average and the starttime of the interval |
| AGG_TYPE_TIMEAVERAGE2 | 4 | This aggregate calculates the area under a sloped or stepped line (depending on the aggregate option 'use_sloped_extrapolation') which connects the simple bounding start value, all good raw values and the simple bounding value at the end and divides this area by the length of the processing interval. It returns this average and the starttime of the interval |
| AGG_TYPE_TOTAL | 5 | This aggregate is the result of the TimeAverage calculation multiplied by the processing interval in seconds. It returns this total value and the starttime of the interval |
| AGG_TYPE_TOTAL2 | 6 | This aggregate is the result of the TimeAverage2 calculation multiplied by the processing interval of good data in seconds. It returns this total and the starttime of the interval |
| AGG_TYPE_VARIANCEPOPULATION | 37 | This aggregate retrieves the square of the standard deviation population |
| AGG_TYPE_VARIANCESAMPLE | 35 | This aggregate retrieves the square of the standard deviation sample |
| AGG_TYPE_WORSTQUALITY | 31 | This aggregate returns the worst status of the raw values in the interval. If multiple extremevalues exist the status 'multiple values' is set. The timestamp returned is the starttime |
| AGG_TYPE_WORSTQUALITY2 | 32 | This aggregate returns the worst status of the raw values in the interval including the simple start bound value. If multiple extremevalues exist the status 'multiple values' is set. The timestamp returned is the starttime |