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

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.
server
The list of server item handles for the items to be inserted or replaced.
timeStamps
Array of FileTimeUTC time stamps for the new values.
dataValues
Array of structures which contain the 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 whether the corresponding server handle was valid.
cancelId

Glossary Item Box

This asynchronous function inserts or replaces values and qualities at the specified timestamps for one or more items. If the item has a value at the specified timestamp, the new value and quality shall replace the old one. If there is no value at that timestamp, the function shall insert the new data.

This function is intended to unconditionally insert/replace values and qualities; e.g., correction of values for bad sensors.

The results are returned via the client's UpdateComplete event handler.

Syntax

Visual Basic (Declaration) 
Public Overloads Function InsertReplace( _
   ByVal transactionID As Integer, _
   ByVal server() As Integer, _
   ByVal timeStamps() As Long, _
   ByVal dataValues() As Object, _
   ByVal qualities() As Integer, _
   ByRef errors As Integer(), _
   ByRef cancelId As Integer _
) As Integer
C# 
public int InsertReplace( 
   int transactionID,
   int[] server,
   long[] timeStamps,
   object[] dataValues,
   int[] qualities,
   out int[] errors,
   out int cancelId
)

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.
server
The list of server item handles for the items to be inserted or replaced.
timeStamps
Array of FileTimeUTC time stamps for the new values.
dataValues
Array of structures which contain the 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 whether the corresponding server handle was valid.
cancelId

Return Value

S_OK, S_FALSE, E_NOTIMPL, E_INVALIDARG, E_FAIL

Remarks

When the UpdateComplete call is sent to the client, S_OK as a error return code for an individual value is allowed when the HDA server is unable to say whether there was already a value at that timestamp.

If the HDA server can determine whether the new value replaces a value that was already there, it should use OPC_S_INSERTED or OPC_S_REPLACED to return that information.

Requirements

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

See Also

Copyright © 2018 Advosol Inc. All Rights Reserved.