AnsweredAssumed Answered

E5071: Difficulty saving Trace Data - Corrupt output files

Question asked by HiramAbiff on Jan 17, 2011
Latest reply on Jan 18, 2011 by odanzy
Hi all,

As always thank you for your help.

I've written the code for a program that is intended to take s-parameter measurements (log mag and phs format) and save the trace data into a csv. My VNA is calibrated from 0.3-3.1GHz and the port1/port2 are connected via an sma bullet. From this setup I expect S21/S12 = 0dB and S11/S22 <-30dB.

The difficulty that I'm having is that the csv files do not have the correct data. When I run program, the S11MAG.csv and S11PHASE.csv contain the correct data, but all the others s-parameters, in the formatted data column of the csv, I see -200 in the mag files and 0 in the phase files. The frequency column lists correct frequencies. If now I re-run the program, now all files (including s11mag/s11phas that were working initially) all have the -200/0 (for mag/phs) in the output csv files. I hope my question makes sense. Below is C# code. Please let me know further clarification of problem is needed. Thanks!

Best regards,

Hiram


      private void btnSPar_Click(object sender, EventArgs e)
      {
          //Button to control Network Analyzer

          Agilent.AgilentNA.Interop.AgilentNA na = null;
          na = new Agilent.AgilentNA.Interop.AgilentNA();        
          na.Initialize("MyVNA", false, false, "");

          na.System.IO.WriteString(":SYST:PRES");
          na.System.IO.WriteString(":MMEM:LOAD 'D:STATE01.STA'");

          // Log Mag Measurement

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement1").Create(1, 1);
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S11MAG.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement2").Create(2, 1);
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S21MAG.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement3").Create(1, 2);
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S12MAG.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement4").Create(2, 2);
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S22MAG.csv'");

          // Phase Measurement

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement1").Create(1, 1);
          na.System.IO.WriteString(":CALC1:FORM PHAS");
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S11PHASE.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement2").Create(2, 1);
          na.System.IO.WriteString(":CALC1:FORM PHAS");
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S21PHASE.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement3").Create(1, 2);
          na.System.IO.WriteString(":CALC1:FORM PHAS");
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S12PHASE.csv'");

          na.Channels.get_Item("Channel1").Measurements.get_Item("Measurement4").Create(2, 2);
          na.System.IO.WriteString(":CALC1:FORM PHAS");
          na.System.IO.WriteString(":MMEM:STOR:FDAT 'D:S22PHASE.csv'");

          na.Close();
         
      }  

Outcomes