OPCDA.NET Reference Manual
AddItems Method
See Also  Send Feedback
OpcDaNetUA.Net4 Assembly > OPCDA.NET Namespace > OpcGroup Class : AddItems Method

arrDef
IN: Array of item definitions. Item access characteristics sucha as the requested data type can be specified.
aRslt
Returns the server item handles that are used in read/write calls to reference the item.
The result structure differs from the OPC specification and additionaly contains the error code. OPC has it in a separate array.

Glossary Item Box

Add a set of items to the group. ( IOPCItemMgt::AddItems ) It is acceptable to add the same item to the group more than once. This will generate a 2nd item with a unique ServerHandle. Any FAILED code in ppErrors indicates that the corresponding item was NOT added to the group and that the corresponding OPCITEMRESULT will not contain useful information. As an alternative to OPC_E_BADTPYE it is acceptable for the server to return any FAILED error returned by VariantChangeType or VariantChangeTypeEx. The server provided item handle will be unique within the group, but may not be unique across groups. The server is allowed to 'reuse' the handles of deleted items. Items cannot be added to public groups. The client needs to free all of the memory associated with the OPCITEMRESULTs including the BLOB. If the server supports the BLOB it will return an updated BLOB in the OPCITEMRESULTs. This BLOB may differ in both content and size from the one passed by the client in OPCITEMDEF.
Note that if an Advise is active, the client will begin receiving callbacks for active items. This can occur very quickly, perhaps even before the client has time to process the returned results. The client must be designed to deal with this. One simple solution is for the client to clear the Active state of the group while doing AddItems and to restore it after the AddItems is completed and the results are processed.

Syntax

Visual Basic (Declaration) 
Public Function AddItems( _
   ByVal arrDef() As OPCItemDef, _
   ByRef aRslt As OPCItemResult() _
) As Integer
C# 
public int AddItems( 
   OPCItemDef[] arrDef,
   out OPCItemResult[] aRslt
)

Parameters

arrDef
IN: Array of item definitions. Item access characteristics sucha as the requested data type can be specified.
aRslt
Returns the server item handles that are used in read/write calls to reference the item.
The result structure differs from the OPC specification and additionaly contains the error code. OPC has it in a separate array.

Return Value

HRESULT success/error code

Requirements

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

See Also

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.