This method reads the values, qualities, timestamps, user ID, and timestamp of the modification from the history database for the specified time domain for one or more items. The purpose of This method is to read values from history that have been modified/replaced. If ReadRaw, ReadProcessed, or ReadAtTime has returned a quality of OPCHDA_EXTRADATA, indicating that there are values which have been superseded, This method reads those values which were superseded. Only values that have been modified/replaced or deleted are read by this method.
The results are returned via the client's IOPCHDA_DataCallback::OnReadModifiedComplete method.
The time domain of the request is defined by startTime and endTime. If endTime is less than startTime, the data shall be returned in reverse order, with later data coming first. Unlike the synchronous method, if numValues is non-zero, the method continues sending data in blocks of size numValues until all requested data has been sent. The cancelID can be used to cancel the request. If a value has been modified multiple times, all values for the time are returned. This means that a time stamp can appear in the array more than once. The order of the returned values with the same time stamp should be from most recent to oldest modified value. It is server dependent whether it keeps multiple modifications or only the most recent. In asynchronous ReadModified, unlike in synchronous, if all three parameters (startTime, endTime, numValues) are specified, the method continues sending data in blocks of size dwNumValues until all requested data has been sent. The cancelID which can be used to cancel the request.
Visual Basic (Declaration) | |
---|---|
Overloads Function ReadModified( _ ByVal transactionID As Integer, _ ByVal startTime As Date, _ ByVal endTime As Date, _ ByVal numValues As Integer, _ ByVal serverHandles() As Integer, _ ByRef cancelID As Integer, _ ByRef errors As Integer() _ ) As Integer |
C# | |
---|---|
int ReadModified( int transactionID, DateTime startTime, DateTime endTime, int numValues, int[] serverHandles, 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 beginning of the history period to be read.
- endTime
- The end of the history period to be read.
- 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.
- serverHandles
- The list of server item handles for the items to be read.
- cancelID
- Place to return a Server generated ID to be used in case the operation needs to be canceled.
- errors
- Array of HRESULTs indicating whether the corresponding server handle was valid.
Return Value
HRESULTS success/error code.The requests are queued and handled by a thread. The sample implementation has
on handling thread. To improve performance it may be necessary in some servers to have
multiple handling threads.
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family