public int GetData(string sparam, out Double[] MagData, out Double[] PhaData) { string mode = GetMode(); SetSmithChart(); int numpoints = GetPoints(); Double[] data = new Double[numpoints]; IMessageBasedFormattedIO io = session.FormattedIO; write(":CALC1:PAR1:DEF " + sparam); Thread.Sleep(GetWaitTime(numpoints)); write(":CALC1:DATA:FDAT?"); io.Scanf("%,f", out data); MagData = new Double[numpoints]; PhaData = new Double[numpoints]; for (int i = 0; i < numpoints; i++) { double magnitude = data[i * 2]; double phase = data[i * 2 + 1]; MagData[i] = magnitude; PhaData[i] = phase; } SetMode(mode); return(numpoints); }
public double[] GetFrequencies() { int numpoints = GetPoints(); Double[] frequencies = new Double[numpoints]; IMessageBasedFormattedIO io = session.FormattedIO; write(":SENS1:FREQ:DATA?"); Thread.Sleep(500); io.Scanf("%,f", out frequencies); return(frequencies); }