AnsweredAssumed Answered

C in Visual Studio to Control VNA E5071C

Question asked by fsuco on Jan 4, 2011
Latest reply on Jan 4, 2011 by odanzy
Hi,

I'm a newbie at C# and just started with programming instruments. I'm currently trying to make the E5071C to measure S21, S12, S11, S22. The end application needs more functionality than that, but I need to at least talk to the instrument and send some basic commands to it.

I've setup a button than when clicked it would measure S-parameters. The code is as follows:

private void btnSPar_Click(object sender, EventArgs e)
        {
            // Button to Measure S-Parameters using VNA
            AgilentNA VNA = new AgilentNA();
            VNA.Initialize("MyVNA", false, true, "");
            AgilentNAMeasurementClass SPar = new AgilentNAMeasurementClass();
            //SPar.GetSparameter(ref int, ref int);
            VNA.Close();
        }

I get the following error message:

"Error     1     Interop type 'Agilent.AgilentNA.Interop.AgilentNAMeasurementClass' cannot be embedded. Use the applicable interface instead."

Where am I going wrong? Also, anybody knows of good books/articles that can help? Thanks for the help.

Franklin  

Outcomes