AnsweredAssumed Answered

4395A Network analyzer how to return to local mode via c (fixed typo)

Question asked by rok on May 2, 2013
Latest reply on May 8, 2013 by rok

Hello,

I had a typo in the model name from my earlier post. I was wondering why I didn't get any replies. 

I'm trying to get the 4395A network analyzer to return from remote to local mode. I tried send 'KEY 48' which supposedly presses the 'Local' mode key but it doesn't work. I also tried the method described in: Local Button  which I adapted to c#.

Here's my C# code:

public void GoLocal() 
{
Ivi.Visa.Interop.ResourceManager drm = new ResourceManager();
Ivi.Visa.Interop.FormattedIO488 vi = new FormattedIO488();
Ivi.Visa.Interop.IGpib gpib;

vi.IO = (IMessage)drm.Open(ConnectionAddress, AccessMode.NO_LOCK, 7000, "4395A");
gpib = (IGpib)vi.IO;
gpib.ControlREN(Ivi.Visa.Interop.RENControlConst.GPIB_REN_GTL);
gpib.Close();

}

This code works for the E444A spectrum analyzer as well as the 34401A multimeters. But I get an exception error of 'HRESULT=80040011' and it fails on this line:

vi.IO = (IMessage)drm.Open(ConnectionAddress, AccessMode.NO_LOCK, 7000, "4395A");

From the microsoft site at: http://support.microsoft.com/kb/186063 
this error means 'Not able to convert object'. 

Can someone let me know how I can get the 4395A to go back to local mode using a C# program?

Thanks,
rok

 

Edited by: rok on May 2, 2013 2:56 PM

Outcomes