Contact an Expert

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


Permlink Replies: 5 - Pages: 1 - Last Post: May 8, 2013 7:18 PM Last Post By: rok Threads: [ Previous | Next ]
rok

Posts: 161
Registered: 04/27/11
4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 2, 2013 1:18 PM
Click to report abuse...   Click to reply to this thread Reply
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: http://www.home.agilent.com/owc_discussions/thread.jspa?messageID=51195 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
bhokkan

Posts: 332
Registered: 12/01/05
Re: 4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 5, 2013 10:45 AM   in response to: rok in response to: rok
Click to report abuse...   Click to reply to this thread Reply
Hello, I noticed you didn't show what is the exact string value in your 'ConnectionAddress' variable for the 4395A case where you get the error. Are you certain your 4395A is set to the GPIB address that your 'ConnectionAddress' is specifying? I've never actually used a 4395A myself, but I would think it should be possible to put them into Local mode using code that's like what you have.
rok

Posts: 161
Registered: 04/27/11
Re: 4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 6, 2013 8:01 PM   in response to: bhokkan in response to: bhokkan
Click to report abuse...   Click to reply to this thread Reply
Hi,

The 'ConnectionAddress' is a string. For the 4395A, it is set to 'GPIB0::16::INSTR'. The other test instruments that I tried it on that worked also had a similar gpib connection address string. (with a different GPIB number of course).

The 4395A seems to be different versus the other Agilent instruments in that it allows you to run HPBasic directly on the instrument itself. Also, the 4395A is odd in that it crashes on certain SCPI commands. (such as SYST:ERR?) So I believe it doesn't support full SCPI command set. Not sure if that is affecting the return to local via gpib operation.

rok
Dr_joel


Posts: 2,744
Registered: 12/01/05
Re: 4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 6, 2013 9:24 PM   in response to: rok in response to: rok
Click to report abuse...   Click to reply to this thread Reply
The 4395A is at least 14 years old, and very likely doesn't follow standard SCPI protocol as it has beed developed over the years. So, I think you are in the "you-get-what-you-get" mode.

If you have the progamming guide, you might find some non-scpi commands such as GTL (go to local), RTL (return to local), LOC (local), LOCAL, LC, LCL, etc.
bhokkan

Posts: 332
Registered: 12/01/05
Re: 4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 7, 2013 7:30 AM   in response to: rok in response to: rok
Click to report abuse...   Click to reply to this thread Reply
I note you didn't say that you checked via the 4395A's softkey menu that it is set to address 16, although perhaps you were implying you had. Although the 4395A's default address would be 16, it's a possibility that someone could have changed it's address at some point.
rok

Posts: 161
Registered: 04/27/11
Re: 4395A Network analyzer how to return to local mode via c# (fixed typo)
Posted: May 8, 2013 7:18 PM   in response to: bhokkan in response to: bhokkan
Click to report abuse...   Click to reply to this thread Reply
Hi,

I did check that its GPIB address was set to 16 since I can talk to the 4935A instrument thru the 'Interactive IO' window from the Agilent Connection Expert, and that was the VISA address shown by ACE when it scanned the GPIB bus. So the problem is not in talking to it, but rather getting it to return back to local mode from remote mode. And I have looked thru the programming manual from cover to cover. I thought the command 'KEY 48' would do the trick, but it didn't. I'll try the other possible suggested commands such as 'GTL' to see if it has any effect or not.

rok

Point your RSS reader here for a feed of the latest messages in all forums