This asynchronous function reads the annotations from the history database in the specified time domain for the specified item IDs.
This function is intended to read annotations for an item at specified timestamps.
The results are returned via the client's ReadAnnotations event handler.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function ReadAnnotations( _ ByVal transactionID As Integer, _ ByVal startTime As OPCHDA.NET.OPCHDAtime, _ ByVal endTime As OPCHDA.NET.OPCHDAtime, _ ByVal server() As Integer, _ ByRef cancelID As Integer, _ ByRef errors As Integer() _ ) As Integer |
C# | |
---|---|
public int ReadAnnotations( int transactionID, OPCHDA.NET.OPCHDAtime startTime, OPCHDA.NET.OPCHDAtime endTime, 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.
- server
- The list of server item handles for the annotation 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 annotation reads. The errors correspond to the handles passed in server. This indicates whether the read succeeded in obtaining a defined annotation item. NOTE any FAILED error code indicates that the corresponding Annotation structure is undefined.
Return Value
S_OK, S_FALSE, 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.
If either startTime or endTime is given in string (relative) format, the absolute time of the OPCHDAtime structure (time) shall be set to the DateTime which the relative time was translated to by the server. OPC_S_NODATA is returned only if no values are returned.
The order of the data returned shall match the order of the ItemIDs in the request.
Target Platforms: Windows 7/8/10, Windows Server 2008/2012/2016, .NET 4.x