OPCDA.NET Reference Manual
Connect(Host,Guid) Method
See Also  Send Feedback
OpcDaNetUA.Net4 Assembly > OPCDA.NET Namespace > OpcServer Class > Connect Method : Connect(Host,Guid) Method

accessInfo
Server access definitions
ClsidOPCserver
IN: CLSID of the server

Glossary Item Box

DEPRECIATED. Use Connect( Host accessInfo, string SrvName ) with SrvName specified as {clsid}
Connect to the remote OPC Server with the specified CLSID on the specified machine. The server access is made with the defined credentials (user/password/domain).
An instance of the OPC COM server is created. The server is launched if it is not already running in the same user. If different applications access the same OPC server then you need to configure DCOM so that all applications launch the OPC server under the same user. Otherwise multiple instances of the OPC server are created.
The method overload has the advantage that OpcEnum on the remote machen needs not be accessed to find the CLSID of the OPC server to be connected.

The Disconnect method needs to be called to release the OPC server before the client program exits.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Connect( _
   ByVal accessInfo As Host, _
   ByVal ClsidOPCserver As Guid _
) As Integer
C# 
public int Connect( 
   Host accessInfo,
   Guid ClsidOPCserver
)

Parameters

accessInfo
Server access definitions
ClsidOPCserver
IN: CLSID of the server

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.