AnsweredAssumed Answered

Getting COMException errors after program was working (no changes done)

Question asked by meta on Nov 23, 2015
Latest reply on Nov 24, 2015 by meta
Hi, I used an example program for C# for GPIB interfacing. It was working fine with my equipment for more than a month but after today the program throws a COMException error with no code. The example program is: 

namespace ExampleProgram
{
    class Program
    {
     
        public static int Main()
        {                    
                ResourceManager rMgr = new ResourceManagerClass();
                FormattedIO488 src = new FormattedIO488Class();
       
                string srcAddress = "GPIB0::30";

                *src.IO = (IMessage)rMgr.Open(srcAddress, AccessMode.NO_LOCK, 2000, null);*
                src.IO.Timeout = 2000;

                src.WriteString("*IDN?", true);
                string temp = src.ReadString();
                System.Console.WriteLine(temp);

            return 0;

        }
    }
}

The error is thrown where the bold line is. Basically, it means I cannot connect to my instruments from C#. 

I am using the Visa COM library type 5.5 and netframework 4.6. 

I really have no idea what could be wrong since Friday night (20-11) it was working fine but this morning (23-11) it did not work anymore and I did not change a single line of code. I noticed there was an IO library suite update on 21-11 but I do not know if this could be a factor. 

I tried reinstalling my NI 488.2 drivers (i use a NI GPIB usb plug) and the IO library suite drivers but no good results. 

Keysight Connection Expert still works properly. I can send GPIB commands to my instrument such as *IDN and I can read the correct response. 

Any insight would be appreciated, thanks.  

Outcomes