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

server
The list of server item handles for the items to be replaced.
timeStamps
Array of FileTimeUTC time stamps for the new values.
dataValues
Array of structures which contain the new item values.
qualities
Array of the quality flags of the new values. These are the Data Access Quality flags, not the HDA quality flags.
errors
OUT: Array of HRESULTs indicating the success of the individual item. The errors correspond to the handles passed in server. This indicates whether the edit succeeded in replacing a defined value, quality and timestamp.

Glossary Item Box

This synchronous function replaces the values and qualities in the history database at the specified timestamps for one or more items.

If no value exists at the specified timestamp, the new value shall not be inserted; instead errors shall indicate an error.

This function is intended to replace existing values at the specified timestamp; e.g., correct lab data that was improperly processed, but inserted into the history database.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Replace( _
   ByVal server() As Integer, _
   ByVal timeStamps() As Date, _
   ByVal dataValues() As Object, _
   ByVal qualities() As Integer, _
   ByRef errors As Integer() _
) As Integer
C# 
public int Replace( 
   int[] server,
   DateTime[] timeStamps,
   object[] dataValues,
   int[] qualities,
   out int[] errors
)

Parameters

server
The list of server item handles for the items to be replaced.
timeStamps
Array of FileTimeUTC time stamps for the new values.
dataValues
Array of structures which contain the new item values.
qualities
Array of the quality flags of the new values. These are the Data Access Quality flags, not the HDA quality flags.
errors
OUT: Array of HRESULTs indicating the success of the individual item. The errors correspond to the handles passed in server. This indicates whether the edit succeeded in replacing a defined value, quality and timestamp.

Return Value

S_OK, S_FALSE, E_NOTIMPL, E_FAIL

Remarks

The server, timeStamps, values and qualities are arrays of equal size.

To replace the values for a number of different items at a single time, then timeStamp array would have the same time for each item. To replace a stream of values, timestamps and qualities for a single item, set the size of the item array to the number of values to be replaced and put the same ItemID in each element.

Requirements

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

See Also

Copyright © 2018 Advosol Inc. All Rights Reserved.