Subclause 5.3 defines additional codes and rules that apply to the StatusCodewhen used for Aggregates.

The general structure of the StatusCodeis specified in OPC 10000-4.It includes a set of common operational result codes which also apply to Aggregates.

In OPC UA Aggregatesthe StatusCodeis used to indicate the conditions under which a value or Eventwas stored, and thereby can be used as an indicator of its usability. Due to the nature of aggregated data, additional information beyond the basic quality and call result code needs to be conveyed to the client.For example, whether or not the result was Interpolated, were all data inputs to a calculation of Good quality, etc.

In the following, Table 8contains codes with Bad severity indicating a failure; Table 9contains codes with Uncertain severity indicating that the value has been retrieved under sub-normal conditions. It is important to note, that these are the codes that are specific for OPC UA Aggregatesand that they supplement the codes that apply to all types of data; they are therefore defined in OPC 10000-4, OPC 10000-8and OPC 10000-11.

Table 8– Bad operation level result codes

Symbolic Id

Description

Bad_AggregateListMismatch

The requested number of Aggregatesdoes not match the requested number of NodeIds.When multiple Aggregatesare requested, a corresponding NodeIdis required for each AggregateFunction.

Bad_AggregateNotSupported

The requested AggregateFunctionis not supported by the Serverfor the specified Node.

Bad_AggregateInvalidInputs

The Aggregatevalue could not be derived due to invalid data inputs, errors attempting to perform data conversions or similar situations.

Table 9– Uncertain operation level result codes

Symbolic Id

Description

Uncertain_DataSubNormal

The value is derived from raw values and has less than the required number of Good values.

These bits are set only when obtaining Aggregatedata. They indicate where the data value came from and provide information that affects how the client uses the data value. Table 10lists the bit settings which indicate the data location (i.e. is the value stored in the underlying data repository, or is the value the result of data aggregation).These bits are mutually exclusive.

Table 10– Data location

StatusCode

Description

Raw

A Raw datavalue.

Calculated

A data value which was calculated.

Interpolated

A data value which was interpolated.

In the case where Interpolateddata is requested, and there is an actual raw value for that timestamp, the Servershould set the ‘Raw’ bit in the StatusCodeof that value.

Table 11lists the bit settings which indicate additional important information about the data values returned.

Table 11– Additional information

StatusCode

Description

Partial

A calculated value that is not based on a complete interval. See 5.3.3.2.

Extra Data

If a Serverchooses to set this bit, it indicates that a Raw datavalue supersedes other data at the same timestamp.

Multiple Values

Multiple values match the Aggregatecriteria (i.e. multiple minimum values or multiple worst quality at different timestamps within the same ProcessingInterval).

The conditions under which these information bits are set depend on how the data has been requested and state of the underlying data repository.

Partialbit is used to indicate that the interval is not a complete interval and that a client may receive a different value for the Aggregateif it re-fetches the interval with the same parameters.

The Partialbit will be set in the following examples:

Assume for these examples the first stored point in the collection is 1:01:10 and the last stored point in the collection is 1:31:20. Older data may exist but is unavailable or offline at the time of the query. Newer data may be available but has not yet been stored in the history collection.

  • The interval that overlaps the beginning of the history collection. If the start time is 1:00:00 and end time is 1:10:00 and the interval is 2 minutes then the first interval would have a Partialbit set since it has no data for the first 70 seconds. The Partialbit will always be set for the first interval with data if the start time of the interval is before the first data value of the data collection. For intervals prior to the interval with a Partialbit, these intervals will be flagged Bad_NoData.
  • The interval that overlaps the latest point stored in the history collection. The last point in the collection is 1:31:20 and the historian was not shut down and is still running. A 6-minute interval that started at 1:30:00 would have the Partialbit set because the historian is expecting data, but just has not yet received anything. The Partialbit will always be set for the last interval with data if the end time of the interval is after the last data value stored in the data collection. Intervals entirely after the interval with a Partialbit will be flagged Bad_NoData. For those Aggregateswith extrapolation, the Partialbit may be set. See the Aggregatespecific characteristics for more details.
  • If the start/end time does not result in an even interval and there is additional data beyond the end time then the last interval will have a Partialbit. If the start time is 1:00:00 and end time is 1:20:00 and the interval is 6 minutes then the last interval is just 2 minutes long and will have the Partialbit set. Extrapolation does not apply in this case.

The Partialbit may be set with the Calculatedbit when the Calculatedbit is always set for the specific Aggregate.