Calculation Modes
Calculation modes are used when the sampling mode is set to Calculated. The data type of all calculated values will be DoubleFloat except for MinimumTime, MaximumTime, FirstRawTime and LastRawTime which will be a Date. The data type of the values of FirstRawValue and LastRawValue will be the same as that of the selected tag.
Calculation Mode | Results |
---|---|
Count | Displays the number of raw samples in the specified interval. This only indicates the count and does not display the actual values or qualities of the samples. The Count calculation mode is useful for analyzing the distribution of raw data samples. If you have a higher number of raw samples than expected, you may decide to implement collector or archive compression. If samples are missing, then you may want to slow your collection rates. |
State Count | Displays the number of times a tag has transitioned to another state from a previous state. A state transition is counted when the previous good sample is not equal to the state value and the next good sample is equal to state value. |
State Time | Displays the duration that a tag was in a given state within an interval. |
Minimum | Displays the minimum value in a specified interval with good data quality. This value may be raw or interpolated. Note: The Minimum and MinimumTime calculation retrieve two additional samples per interval; one is interpolated at the interval start time and the other is interpolated at the interval end time. These samples are used to determine the min or max just like any raw value. |
MinimumTime | Displays the time stamp of the minimum value in a specified interval. See the note in Minimum for additional information. |
Maximum | Displays the maximum value in a specified interval. Note: The Maximum and MaximumTime calculation internally retrieve two additional samples per interval; one is interpolated at the interval start time and the other is interpolated at the interval end time. These samples are used in the min or max just like any raw or interpolated value. |
MaximumTime | Displays the time stamp of the maximum value in a specified interval. See the note in Maximum for additional information. |
RawAverage | Displays the arithmetic average of the raw values in a specified interval with good data quality. This is useful only when a sufficient number of raw data values are collected. |
Average | Similar to RawAverage, but performs a special logic for time weighting and for computing the value at the start of the interval. This is useful for computing an average on compressed data. |
OPCQOr and OPCQAnd | The OPCQOr is a bit wise OR operation of all the 16 bit OPC qualities of the raw samples stored in the specified interval. The OPCQAnd is a bit wise AND operation of all the 16 bit OPC qualities of the raw samples stored in the specified interval. |
Total | Retrieves the time-weighted total of raw and interpolated values for each calculation interval. The collected value must be a rate per 24 hours. This calculation mode determines a count from the collected rate. |
RawTotal | Displays the arithmetic sum of raw values in a specified interval. |
StandardDeviation | Displays the time-weighted standard deviation of raw values for a specified interval. |
RawStandardDeviation | Displays the arithmetic standard deviation of raw values for a specified interval. |
TimeGood | Displays the amount of time (in milliseconds) during an interval when the data is of good quality and matches filter conditions if the filter tag is used. |
FirstRawValue | Returns the first good raw value for a specified time interval. |
FirstRawTime | Returns the timestamp of the first good raw for a specified time interval. |
LastRawValue | Returns the last good raw value for a specified time interval. |
LastRawTime | Returns the timestamp of the last good raw for a specified time interval. |
TagStats | Allows you to return multiple calculation modes for a tag in a single query. |