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. OpcEnum is accessed with the defined credentials.
The Disconnect method needs to be called to release the OPC server before the client program exits.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function Connect( _ ByVal accessInfo As Host, _ ByVal SrvName As String _ ) As Integer |
C# | |
---|---|
public int Connect( Host accessInfo, string SrvName ) |
Parameters
- accessInfo
- Computer name and optional username/password/domain
- SrvName
- Server ProgId