Connecting to OPC Server from VB 2012 winforms project 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)



            GlobalOPCServer = Nothing

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

    Retrieving the COM class factory for component with CLSID 
    failed due to the following error: 
    80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    Sunday, July 7, 2019 4:13 AM


All replies