QuickOPC User's Guide and Reference
_ServerElement Interface
Members  Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.ComTypes Namespace : _ServerElement Interface
Exposes OpcLabs.EasyOpc.ServerElement to COM clients.
Object Model
_ServerElement InterfaceServerCategories Class
Syntax
'Declaration
 
<CLSCompliantAttribute(False)>
<ComVisibleAttribute(True)>
<GuidAttribute("2E13A404-1528-4924-9B3B-A906A10E4092")>
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)>
Public Interface _ServerElement 
'Usage
 
Dim instance As _ServerElement
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("2E13A404-1528-4924-9B3B-A906A10E4092")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface _ServerElement 
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("2E13A404-1528-4924-9B3B-A906A10E4092")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface class _ServerElement 
Example
// This example shows all information available about OPC servers.

using System;
using OpcLabs.EasyOpc;
using OpcLabs.EasyOpc.DataAccess;
using OpcLabs.EasyOpc.OperationModel;

namespace DocExamples._ServerElement
{
    class General
    {
        public static void Main1()
        {
            // Instantiate the client object.
            var client = new EasyDAClient();

            ServerElementCollection serverElements;
            try
            {
                serverElements = client.BrowseServers();
            }
            catch (OpcException opcException)
            {
                Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
                return;
            }

            foreach (ServerElement serverElement in serverElements)
            {
                Console.WriteLine($"Information about server \"{serverElement}\":");
                Console.WriteLine($"    .ServerClass: {serverElement.ServerClass}");
                Console.WriteLine($"    .ClsidString: {serverElement.ClsidString}");
                Console.WriteLine($"    .ProgId: {serverElement.ProgId}");
                Console.WriteLine($"    .Description: {serverElement.Description}");
                Console.WriteLine($"    .Vendor: {serverElement.Vendor}");
                Console.WriteLine($"    .ServerCategories: {serverElement.ServerCategories}");
                Console.WriteLine($"    .VersionIndependentProgId: {serverElement.VersionIndependentProgId}");
            }


            // Example output:
            //
            //Information about server "opcda:OPCLabs.KitServer.2%7Bc8a12f17-1e03-401e-b53d-6c654dd576da%7D":
            //    .ServerClass: OPCLabs.KitServer.2
            //    .ClsidString: c8a12f17-1e03-401e-b53d-6c654dd576da
            //    .ProgId: OPCLabs.KitServer.2
            //    .Description: OPC Labs Kit Server
            //    .Vendor: OPC Labs, http://www.opclabs.com
            //    .ServerCategories: (OpcDataAccess10, OpcDataAccess20, OpcDataAccess30)
            //    .VersionIndependentProgId: OPCLabs.KitServer
        }
    }
}
Rem This example shows all information available about OPC servers.

Option Explicit

Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.DataAccess.EasyDAClient")
On Error Resume Next
Dim ServerElements: Set ServerElements = Client.BrowseServers("")
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0

Dim ServerElement: For Each ServerElement In ServerElements
    WScript.Echo "Information about server """ & ServerElement & """:"
    With ServerElement
        WScript.Echo Space(4) & ".ServerClass: " & .ServerClass
        WScript.Echo Space(4) & ".ClsidString: " & .ClsidString
        WScript.Echo Space(4) & ".ProgId: " & .ProgId
        WScript.Echo Space(4) & ".Description: " & .Description
        WScript.Echo Space(4) & ".Vendor: " & .Vendor
        WScript.Echo Space(4) & ".ServerCategories.ToString(): " & .ServerCategories.ToString()
        WScript.Echo Space(4) & ".VersionIndependentProgId: " & .VersionIndependentProgId
    End With
Next
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2012, Windows Server 2016; .NET Core, .NET 5, .NET 6: Linux, macOS, Microsoft Windows

See Also

Reference

_ServerElement Members
OpcLabs.EasyOpc.ComTypes Namespace