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

SrvName
Server ProgId name in the form serverName or \\machineName\serverName or //machineName/serverName

Glossary Item Box

Connect to the named OPC Server.
The name is the Server's ProgId such as Advosol.SimDAServer.1 to connect to a local OPC server. To connect to a remote server either:
a) specify the fully qualified name such as \\Comp17\Advosol.SimDAServer.1
b) use the Connect(string,string) method

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 OpcEnum server browser is accessed on the remote machine to find the CLSID of the named OPC server.

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 SrvName As String _
) As Integer
C# 
public int Connect( 
   string SrvName
)

Parameters

SrvName
Server ProgId name in the form serverName or \\machineName\serverName or //machineName/serverName

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.