OPCHDA.NET-UA
ReadAtTime(DateTime[],Int32[],OPCHDAitem[],Int32[]) Method
See Also  Send Feedback
OpcHDaNetUaOption.Net4 Assembly > hdaUAwrapper Namespace > HDAServer Class > ReadAtTime Method : ReadAtTime(DateTime[],Int32[],OPCHDAitem[],Int32[]) Method

timeStamps
The timestamps for the requested data.
server
The list of server item handles for the items to be read.
itemValues
OUT: Array of structures in which the item values are returned. The order of the structures in the array shall be the same as the order of the server item handles.
errors
OUT: Array of HRESULTs indicating the success of the individual item reads. The errors correspond to the handles passed in server. This indicates whether the read succeeded in obtaining a defined value, quality and timestamp. NOTE that any FAILED error code indicates that the corresponding OPCHDAitem struct is undefined.

Glossary Item Box

This synchronous function reads the values and qualities from the history database for the specified timestamps for one or more items. This function is intended to provide values to correlate with other values with a known timestamp. For example, the values of sensors when lab samples were collected.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ReadAtTime( _
   ByVal timeStamps() As Date, _
   ByVal server() As Integer, _
   ByRef itemValues As OPCHDAitem(), _
   ByRef errors As Integer() _
) As Integer
C# 
public int ReadAtTime( 
   DateTime[] timeStamps,
   int[] server,
   out OPCHDAitem[] itemValues,
   out int[] errors
)

Parameters

timeStamps
The timestamps for the requested data.
server
The list of server item handles for the items to be read.
itemValues
OUT: Array of structures in which the item values are returned. The order of the structures in the array shall be the same as the order of the server item handles.
errors
OUT: Array of HRESULTs indicating the success of the individual item reads. The errors correspond to the handles passed in server. This indicates whether the read succeeded in obtaining a defined value, quality and timestamp. NOTE that any FAILED error code indicates that the corresponding OPCHDAitem struct is undefined.

Return Value

S_OK, S_FALSE, E_NOTIMPL, E_INVALIDARG, E_FAIL

Remarks

The order of the values and qualities returned shall match the order of the time stamps supplied in the request.

When no value exists for a specified timestamp, a value shall be interpolated from the surrounding values to represent the value at the specified timestamp.

The interpolation will follow the same rules as the standard Intpolated aggregate as outlined in specification Section 2.9 The OPCHDAitem structure will return OPCHDA_NOAGGREGATE in the aggregate field. If a value is found for the specified timestamp, the server will set the OPCHDA_RAW bit in the quality. If the value is interpolated from the surrounding values, the server will set the OPCHDA_INTERPOLATED bit in the quality.

Requirements

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

See Also

Copyright © 2018 Advosol Inc. All Rights Reserved.