AnsweredAssumed Answered

Beginning GPIB COM Issue

Question asked by chrisand6 on Aug 21, 2008
Latest reply on Aug 22, 2008 by odanzy
Hello,

I have done some GPIB programming and automation in VB6, but I have recently made the transition to VB .NET 2008.  Its been a couple years since I have had to do this, so I tried to do a simple 'Getting Started ' approach.

I would provide the 'getting started'  links from the Agilent website that I have tried, but the forum won't allow me to post links.


I produced the following code, but I get a strange COM related error.

        Dim instrument As VisaComLib.FormattedIO488
        Dim ioMgr As VisaComLib.ResourceManager
        Try
            ioMgr = New VisaComLib.ResourceManager

            instrument = New VisaComLib.FormattedIO488
            instrument.IO = ioMgr.Open("GPIB0::22")
            instrument.WriteString("*IDN?")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

        Dim idn As String = ""

        Try
            idn = instrument.ReadString()
            MsgBox("The IDN String is: " & idn, vbOKOnly, "IDN Result")
        Catch ex As Exception
            MsgBox(ex.Message)

        End Try


When I catch the error from the Try block, it reads:

"Retrieving the COM class factory for component with CLSID {DB8CBF1D-D6D3-11D4-AA51-00A024EE30B8} failed due to the following error 80040154"

This doesn't seem hardware related, because I can send the same command through NI Measurement and Automation explorer and the instrument responds. 

Has anyone else had this problem before to know what I need to do to Visual Studio to fix this COM error? 

thanks,

Chris Anderson  

Outcomes