This asynchronous function 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 function is to read values from history that have been modified/replaced (a value was returned with a quality of OPCHDA_EXTRADATA, indicating that there were other values for that item/timestamp which had been superseded).
The results are returned via the client's ReadModifiedComplete event handler.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function ReadModified( _ ByVal transactionID As Integer, _ ByVal startTime As OPCHDAtime, _ ByVal endTime As OPCHDAtime, _ ByVal numValues As Integer, _ ByVal server() As Integer, _ ByRef cancelID As Integer, _ ByRef errors As Integer() _ ) As Integer |
C# | |
---|---|
public int ReadModified( int transactionID, OPCHDAtime startTime, OPCHDAtime endTime, int numValues, 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 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.
- 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 whether the corresponding server handle was valid.
Return Value
S_OK, S_FALSE, E_NOTIMPL, E_INVALIDARG, E_FAILThe 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 function 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 and numValues) are specified, the function continues sending data in blocks of size numValues until all requested data has been sent. The CancelID which can be used to cancel the request.
Target Platforms: Windows 7/8/10, Windows Server 2008/2012/2016, .NET 4.x