AnsweredAssumed Answered

Can I use Agilent VISA Library for RS232 communication?

Question asked by Stuttgart21 on Jan 17, 2011
Latest reply on Jan 17, 2011 by Stuttgart21
I have a C# program which communicates with Agilent Data Acquisition Unit (34970A). I can communicate via GPIB or RS232 - both works perfectly.

I have another little device (conditioning cabinett) which supports RS232. I just want to send a string to this device (and receive a string) via RS232.

Is this also possible with the Agilent VISA Library?

        Ivi.Visa.Interop.ResourceManager IOMGr = new Ivi.Visa.Interop.ResourceManager();
        Ivi.Visa.Interop.FormattedIO488 Instrument = new Ivi.Visa.Interop.FormattedIO488();
        Instrument.IO = (Ivi.Visa.Interop.IMessage)IOMGr.Open("ASRL1::INSTR", Ivi.Visa.Interop.AccessMode.NO_LOCK, 2000, ""); // --> ERROR MESSAGE

After the last line I get an exception "HRESULT = 80040072". What does this mean?
ASRL1::INSTR is the alias for COM1. With the Agilent 34970A the code above works perfectly. The other parameters are the default values (because in C# you may not leave any parameter empty like in VB.NET and so on).
Any idea what to do?