none
Connecting to OPC Server RRS feed

  • Question

  • I want to connect an OPC Server in my project.

    I define a connection to the OPC Server and when I run the following code:

            Dim GlobalOPCServer As OPCAutomation.OPCServerClass

            Dim ConnectedOPCServer As OPCAutomation.OPCServerClass

            Dim ConnectedGroup As OPCAutomation.OPCGroupClass

            GlobalOPCServer = New OPCAutomation.OPCServerClass()

            Dim ServerList As Object = GlobalOPCServer.GetOPCServers

            For index As Short = LBound(ServerList) To UBound(ServerList)

                MsgBox(ServerList(index).ToString)

            Next

            GlobalOPCServer = Nothing

    I get the following error on "GlobalOPCServer = New OPCAutomation.OPCServerClass()" line:

    Retrieving the COM class factory for component with CLSID 
    {28E68F9A-8D75-11D1-8DC3-3C302A000000} 
    failed due to the following error: 
    80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).


    Wednesday, July 3, 2019 7:33 AM

All replies