This Serviceis used to read historical values or Eventsof one or more Nodes. For constructed Attributevalues whose elements are indexed, such as an array, this Serviceallows Clientsto read the entire set of indexed values as a composite, to read individual elements or to read ranges of elements of the composite. Serversmay make historical values available to Clientsusing this Service, although the historical values themselves are not visible in the AddressSpace.

The AccessLevel Attributedefined in OPC 10000-3indicates a Node’s support for historical values. Several request parameters indicate how the Serveris to access values from the underlying history data source. The EventNotifier Attributedefined in OPC 10000-3indicates a Node’s support for historical Events.

The continuationPointparameter in the HistoryReadis used to mark a point from which to continue the read if not all values could be returned in one response. The value is opaque for the Clientand is only used to maintain the state information for the Serverto continue from. A Servermay use the timestamp of the last returned data item if the timestamp is unique. This can reduce the need in the Serverto store state information for the continuation point.

In some cases it may take longer than the Clienttimeout hint to read the data for all nodes to read. Then the Servermay return zero results with a continuation point for the affected nodes before the timeout expires. That allows the Serverto resume the data acquisition on the next Clientread call.

For additional details on reading historical data and historical Eventssee OPC 10000-11.

Table 56defines the parameters for the Service.

Table 56– HistoryRead Service Parameters

Name

Type

Description

Request

requestHeader

RequestHeader

Common request parameters (see 7.28for RequestHeaderdefinition).

historyReadDetails

Extensible Parameter

HistoryReadDetails

The details define the types of history reads that can be performed. The HistoryReadDetailsparameter type is an extensible parameter type formally defined in OPC 10000-11. The ExtensibleParametertype is defined in 7.12.

timestampsToReturn

Enum

TimestampsTo Return

An enumeration that specifies the timestamps to be returned for each requested Variable Value Attribute. The TimestampsToReturnenumeration is defined in 7.35.

Specifying a TimestampsToReturnof NEITHER is not valid. A Servershall return a Bad_InvalidTimestampArgument StatusCodein this case.

OPC 10000-11defines exceptions where this parameter shall be ignored.

releaseContinuation

Points

Boolean

A Booleanparameter with the following values:

TRUEpassed continuationPointsshall be reset to free resources in the Server.

FALSEpassed continuationPointsshall be used to get the next set of historical information.

A Clientshall always use the continuation point returned by a HistoryReadresponse to free the resources for the continuation point in the Server. If the Clientdoes not want to get the next set of historical information, HistoryReadshall be called with this parameter set to TRUE.

nodesToRead []

HistoryReadValueId

This parameter contains the list of items upon which the historical retrieval is to be performed. This structure is defined in-line with the following indented items.

nodeId

NodeId

If the HistoryReadDetailsisRAW, PROCESSED, MODIFIED or ATTIME:

The nodeIdof the Nodeswhose historical values are to be read. The value returned shall always include a timestamp.

If the HistoryReadDetailsisEVENTS:

The NodeIdof the Nodewhose Eventhistory is to be read.

If the Nodedoes not support the requested access for historical values or historical Eventsthe appropriate error response for the given Nodeshall be generated.

indexRange

NumericRange

This parameter is used to identify a single element of an array, or a single range of indexes for arrays. If a range of elements is specified, the values are returned as a composite. The first element is identified by index 0 (zero). The NumericRangetype is defined in 7.22.

This parameter is null if the value is not an array. However, if the value is an array, and this parameter is null, then all elements are to be included in the range.

dataEncoding

QualifiedName

A QualifiedNamethat specifies the data encoding to be returned for the Valueto be read (see 7.24for definition how to specify the data encoding).

This parameter only applies if the DataTypeof the Variableis a subtype of Structure. It is an error to specific this parameter if the DataTypeof the Variableis not a subtype of Structure.

The parameter is ignored when reading history of Events.

continuationPoint

ContinuationPoint

For each NodesToReaditem this parameter specifies a continuation point returned from a previous HistoryReadcall, allowing the Clientto continue that read from the last value received.

The HistoryReadis used to select an ordered sequence of historical values or events. A continuation point marks a point in that ordered sequence, such that the Serverreturns the subset of the sequence that follows that point.

A null value indicates that this parameter is not used.

See 7.6for a general description of continuation points.

This continuation point is described in more detail in OPC 10000-11.

Response

responseHeader

ResponseHeader

Common response parameters (see 7.29for ResponseHeadertype).

results []

HistoryReadResult

List of read results. The size and order of the list matches the size and order of the nodesToReadrequest parameter. This structure is defined in-line with the following indented items.

statusCode

StatusCode

StatusCodefor the NodesToReaditem (see 7.34for StatusCodedefinition).

continuationPoint

ContinuationPoint

This parameter is used only if the number of values to be returned is too large to be returned in a single response or if the timeout provided as hint by the Clientis close to expiring and not all nodes have been processed.

When this parameter is not used, its value is null.

Serversshall support at least one continuation point per Session. Serversspecify a max history continuation points per Sessionin the Servercapabilities Objectdefined in OPC 10000-5. A continuation point shall remain active until the Clientpasses the continuation point to HistoryReador the Sessionis closed. If the max continuation points have been reached the oldest continuation point shall be reset.

historyData

Extensible Parameter

HistoryData

The history data returned for the Node.

The HistoryDataparameter type is an extensible parameter type formally defined in OPC 10000-11. It specifies the types of history data that can be returned. The ExtensibleParameterbase type is defined in 7.12.

diagnosticInfos []

Diagnostic Info

List of diagnostic information. The size and order of the list matches the size and order of the nodesToReadrequest parameter. There is one entry in this list for each Nodecontained in the nodesToReadparameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.

Table 57defines the Serviceresults specific to this Service. Common StatusCodesare defined in Table 177.

Table 57– HistoryRead Service Result Codes

Symbolic Id

Description

Bad_NothingToDo

See Table 177for the description of this result code.

Bad_TooManyOperations

See Table 177for the description of this result code.

Bad_TimestampsToReturnInvalid

See Table 177for the description of this result code.

Bad_HistoryOperationInvalid

See Table 178for the description of this result code.

Bad_HistoryOperationUnsupported

See Table 178for the description of this result code.

The requested history operation is not supported by the server.

Table 58defines values for the operation level statusCodeparameter that are specific to this Service. Common StatusCodesare defined in Table 178. History access specific StatusCodesare defined in OPC 10000-11.

Table 58– HistoryRead Operation Level Result Codes

Symbolic Id

Description

Bad_NodeIdInvalid

See Table 178for the description of this result code.

Bad_NodeIdUnknown

See Table 178for the description of this result code.

Bad_DataEncodingInvalid

See Table 178for the description of this result code.

Bad_DataEncodingUnsupported

See Table 178for the description of this result code.

Bad_UserAccessDenied

See Table 177for the description of this result code.

Bad_ContinuationPointInvalid

See Table 177for the description of this result code.

Bad_InvalidTimestampArgument

The defined timestamp to return was invalid.

Bad_HistoryOperationUnsupported

See Table 178for the description of this result code.

The requested history operation is not supported for the requested node.

Bad_NoContinuationPoints

See Table 178for the description of this result code.

See 7.6for the rules to apply this status code.