OPCHDA.NET Reference Manual
ReadRawWithUpdate Method
See Also  Send Feedback
OpcHDAWrapperUA.Net4 Assembly > OPCHDA.NET Namespace > OpcHDAServer Class : ReadRawWithUpdate Method

transactionID
An identifier created by the client and passed to the server in this call. The server shall return this identifier along with the results of this call.
startTime
The earliest time of the history to be read.
endTime
The latest time of the history to be read. The end time must be greater than the start time, otherwise INVALID_PARMS is returned.
numValues
The maximum number of values returned for any item over the time range. If only one time is specified, this number specifies the extent of the time range.
updateDuration
The amount of time the update covers in.
updateInterval
The interval to send data for updates.
server
The list of server item handles for the items to be read.
cancelID
OUT: Place to return a Server generated ID to be used in case the operation needs to be canceled.
errors
OUT: Array of HRESULTs indicating the success of the individual item reads. Indicates only whether the corresponding server handle was valid.

Glossary Item Box

The playback functionality of a History server provides the capability to get an initial set of data from the History server and then get continual updates of historical data. This is different than the Asynchronous Advise methods in that those methods are centered around the current time. The playback interface supports methods that retrieval data from the past and then supply updates from stored data. Typically the updates are sent at a rate that is more frequent than the time the data was stored. For example, the request could be to send 10 minutes worth of data every minute.

This function is intended to be used to playback raw history data.

By controlling the update interval, the data can be displayed on trends in real time, in slower motion, or faster than real time. This function initially retrieves data from the start time to the end time. After the initial response it periodically (every updateInterval) responds with an updateDuration amount of data.

The time of the last value returned in the initial response is used as the start time for the first update. After that, the time of the last value returned in an update is used as the start time for the next update.

The results are returned via the client's Playback event handler.

Syntax

Visual Basic (Declaration) 
Public Function ReadRawWithUpdate( _
   ByVal transactionID As Integer, _
   ByRef startTime As OPCHDA.NET.OPCHDAtime, _
   ByRef endTime As OPCHDA.NET.OPCHDAtime, _
   ByVal numValues As Integer, _
   ByVal updateDuration As TimeSpan, _
   ByVal updateInterval As TimeSpan, _
   ByVal server() As Integer, _
   ByRef cancelID As Integer, _
   ByRef errors As Integer() _
) As Integer
C# 
public int ReadRawWithUpdate( 
   int transactionID,
   ref OPCHDA.NET.OPCHDAtime startTime,
   ref OPCHDA.NET.OPCHDAtime endTime,
   int numValues,
   TimeSpan updateDuration,
   TimeSpan updateInterval,
   int[] server,
   out int cancelID,
   out int[] errors
)

Parameters

transactionID
An identifier created by the client and passed to the server in this call. The server shall return this identifier along with the results of this call.
startTime
The earliest time of the history to be read.
endTime
The latest time of the history to be read. The end time must be greater than the start time, otherwise INVALID_PARMS is returned.
numValues
The maximum number of values returned for any item over the time range. If only one time is specified, this number specifies the extent of the time range.
updateDuration
The amount of time the update covers in.
updateInterval
The interval to send data for updates.
server
The list of server item handles for the items to be read.
cancelID
OUT: Place to return a Server generated ID to be used in case the operation needs to be canceled.
errors
OUT: Array of HRESULTs indicating the success of the individual item reads. Indicates only whether the corresponding server handle was valid.

Return Value

S_OK, S_FALSE, OPC_E_MAXEXCEEDED, E_INVALIDARG, E_FAIL

Remarks

Playback is only supported in the forward direction. The domain of the initial request is defined by startTime, endTime, and numValues

The value of startTime must be defined. If endTime is not specified, the request shall be for all data from the startTime for the requested number of values. Then further data shall be sent according to the updateDuration and updateInterval from the time of the last value returned. If either the startTime or endTime is given in string (relative) format, the absolute time of the OPCHDAtime structure (time) will be set to the DateTime the relative time was translated to by the server.

This request continues sending data in blocks of numVals until all requested data has been sent, returns transaction ID which can be used to cancel the request, and uses the update rate on the group to throttle the rate of block returns. The numValues defines the maximum number of values for any item which will be returned in a single callback. This could be for the initial set of data or any subsequent updates (notice therefore that an update may require more than one callback). Implementation of the operation is server dependent.

Requirements

Target Platforms: Windows 7/8/10, Windows Server 2008/2012/2016, .NET 4.x

See Also

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.