This asynchronous function asynchronously reads the values, qualities, and timestamps from the history database for the specified time domain for one or more items.
When bBounds is TRUE, the bounding values for the time domain are returned. This function is intended for use by clients wanting the actual data saved within the historian.
The actual data may be compressed or may be all data collected for the item depending on the historian and the storage rules invoked when the item values were saved. The optional bounding values are provided to allow clients to interpolate values for the start and end times when trending the actual data on a display.
The results are returned via the client's ReadComplete event handler.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function ReadRaw( _ ByVal transactionID As Integer, _ ByVal startTime As OPCHDAtime, _ ByVal endTime As OPCHDAtime, _ ByVal numValues As Integer, _ ByVal bounds As Boolean, _ ByVal server() As Integer, _ ByRef cancelID As Integer, _ ByRef errors As Integer() _ ) As Integer |
C# | |
---|---|
public int ReadRaw( int transactionID, OPCHDAtime startTime, OPCHDAtime endTime, int numValues, bool bounds, 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, the time range must extend to return this number of values.
- bounds
- True if bounding values should be returned.
- 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, OPC_E_MAXEXCEEDED, 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 either startTime or endTime is given in string (relative) format, the absolute time of the OPCHDA_TIME structure (time) shall be set to the DateTime which the relative time was translated to by the server. A null value for OPCHDAtime (see specification section 5.3.4) is used to indicate startTime or endTime is not specified.
The callback shall contain data for all ItemIDs in the request except those for which a FAILED error code was returned. See the discussion at IOPCHDA_SyncRead:ReadRaw for specifics of what a server should return to the client in various situations.
Target Platforms: Windows 7/8/10, Windows Server 2008/2012/2016, .NET 4.x