OPC Historian .NET Server Toolkit Reference
ReadModified(DateTime,DateTime,Int32,Int32[],OPCHDAModifiedItem[],Int32[]) Method

The beginning of the history period to be read.
The end of the history period to be read.
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.
The list of server item handles for the items to be read.
Array of objects in which the item values are returned. The order of the objects in the array shall be the same as the order of the server item handles.
Array of HRESULTs indicating the success of the individual item reads. The errors correspond to the handles passed in phServer. This indicates whether the read succeeded in obtaining a defined value, quality and time stamp. NOTE that any FAILED error code indicates that the corresponding OPCHDA_MODIFIEDITEM struct is undefined.
Synchronous ReadModified.
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 domain of the request is defined by startTime, endTime, and numValues; at least two of these must be specified. If endTime is less than startTime, or endTime and numValues alone are specified, the data shall be returned in reverse order, with later data coming first. If all three are specified, the call shall return up to numValues results going from startTime to endTime, in either ascending or descending order depending on the relative values of startTime and endTime. If more than numValues results exist within that time range, the errors entry for that ItemID shall be OPC_S_MOREDATA. If numValues is 0, then all the values in the range are returned. If a value has been modified multiple times, all values for the time are returned. This means that a timestamp can appear in the array more than once. The order of the returned values with the same timestamp should be from most recent to oldest modified value. It is server dependent whether multiple modifications are kept or only the most recent.
Syntax
'Usage
 
Dim instance As AppPlugin
Dim startTime As Date
Dim endTime As Date
Dim numValues As Integer
Dim serverHandles() As Integer
Dim itemValues As OPCHDAModifiedItem()
Dim errors As Integer()
Dim value As Integer
 
value = instance.ReadModified(startTime, endTime, numValues, serverHandles, itemValues, errors)
public int ReadModified( 
   DateTime startTime,
   DateTime endTime,
   int numValues,
   int[] serverHandles,
   out OPCHDAModifiedItem[] itemValues,
   out int[] errors
)

Parameters

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.
itemValues
Array of objects in which the item values are returned. The order of the objects in the array shall be the same as the order of the server item handles.
errors
Array of HRESULTs indicating the success of the individual item reads. The errors correspond to the handles passed in phServer. This indicates whether the read succeeded in obtaining a defined value, quality and time stamp. NOTE that any FAILED error code indicates that the corresponding OPCHDA_MODIFIEDITEM struct is undefined.

Return Value

HRESULTS success/error code.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AppPlugin Class
AppPlugin Members
Overload List

 

 


Copyright © 2004-2019 Advosol Inc. All rights reserved

Send Feedback