Пример #1
0
        public void Run()
        {
            #region Create Sessions
            FocusITunerBroker iTuner = new FocusITunerBroker();
            iTuner.Initialize(tunerAddress, false, true);
            NIRfsg       nIRfsg = new NIRfsg(resourceName, false, false);
            RFmxInstrMX  instr  = new RFmxInstrMX(resourceName, "");
            RFmxSpecAnMX specAn = instr.GetSpecAnSignalConfiguration(signalStringSpecan);
            #endregion

            #region Configure Tuner
            FocusTuner.ConfigureCommon(iTuner, commonConfiguration);
            #endregion

            #region Configure Generation
            ConfigureInstrument(nIRfsg, sgInstrConfig);
            Waveform waveform = LoadWaveformFromTDMS(filePath);
            DownloadWaveform(nIRfsg, waveform);
            ConfigureContinuousGeneration(nIRfsg, waveform);
            nIRfsg.Initiate();
            #endregion

            #region Configure Analyzer
            saAutolevelConfig.MeasurementInterval_s = waveform.BurstLength_s;
            RFmxInstr.ConfigureInstrument(instr, saInstrConfig);
            RFmxSpecAn.ConfigureCommon(specAn, saCommonConfig);
            RFmxSpecAn.ConfigureTxp(specAn, txpConfigurationSpecAn);
            #endregion

            #region Measure
            foreach (var gamma in gammaSweep)
            {
                Console.WriteLine("\n--------------------- Tuning --------------------\n");
                currentGamma = FocusTuner.MoveTunerPerGamma(iTuner, gamma)[0];
                PrintTuneResults();

                Console.WriteLine("\n--------------------- Results --------------------\n");
                RFmxSpecAnMXMeasurementTypes[] specanMeasurements = new RFmxSpecAnMXMeasurementTypes[1] {
                    RFmxSpecAnMXMeasurementTypes.Txp
                };
                RFmxSpecAn.SelectAndInitiateMeasurements(specAn, specanMeasurements, saAutolevelConfig, waveform.SignalBandwidth_Hz, false, "", resultStringSpecan);
                txpResultsSpecAn = RFmxSpecAn.FetchTxp(specAn, RFmxSpecAnMX.BuildResultString(resultStringSpecan));
                PrintTxPResults();
            }
            #endregion

            AbortGeneration(nIRfsg);
            CloseInstrument(nIRfsg);
            FocusTuner.CloseTuner(iTuner);
            specAn.Dispose();
            specAn = null;
            instr.Close();
            instr = null;
        }
Пример #2
0
 /// <summary>Configures common settings for load pull using the Focus tuner.</summary>
 /// <param name="iTuner">Specifies a reference to the instrument.</param>
 /// <param name="commonConfiguration">Specifies the settings for load pull using the Focus tuner.</param>
 /// <returns>The primary frequency in GHz, of the active tuner calibration data set.</returns>
 public static double ConfigureCommon(FocusITunerBroker iTuner, CommonConfiguration commonConfiguration)
 {
     Complex[][] sParameters = new Complex[commonConfiguration.DUTtoTunerSParameters.Length][];
     for (int i = 0; i < sParameters.Length; i++)
     {
         SParameters element = commonConfiguration.DUTtoTunerSParameters[i];
         sParameters[i] = new Complex[] { element.S11, element.S12, element.S21, element.S22 };
     }
     iTuner.ConfigureTunerMode(commonConfiguration.TunerMode);
     iTuner.ConfigureActiveCalibration(commonConfiguration.CalibrationID);
     iTuner.ConfigureAdapter(sParameters);
     iTuner.ConfigureTermination(commonConfiguration.LoadTermination);
     double[] frequencies = iTuner.QueryActiveFrequency();
     return(frequencies[0]);
 }
Пример #3
0
 /// <summary>Reinitializes all the axes of the tuner to its home position before terminating the software connection to the instrument.</summary>
 /// <param name="iTuner">Specifies a reference to the instrument.</param>
 public static void CloseTuner(FocusITunerBroker iTuner)
 {
     iTuner.InitializeTunerAllAxises();
     iTuner.Close();
 }
Пример #4
0
 /// <summary>Moves the specified tuner axis to the given positions with timeout.</summary>
 /// <param name="iTuner">Specifies a reference to the instrument.</param>
 /// <param name="motorPositions">Specifies the positions to which one or more motors should move.</param>
 /// <param name="timeout">Specifies the maximum length of time, in seconds, to allow the operation to complete. The default is 60.</param>
 /// <returns>The current position of each tuner motor axis.</returns>
 public static MotorPosition[] MoveTunerPerMotorPosition(FocusITunerBroker iTuner, MotorPosition[] motorPositions, short timeout = 60)
 {
     iTuner.MoveTunerPerMotorPosition(motorPositions);
     iTuner.WaitForOperationComplete(timeout);
     return(iTuner.QueryCurrentMotorPositionAll());
 }
Пример #5
0
 /// <summary>Adjusts the positions of the tuner axes to present the specified voltage standing wave ratio (VSWR) in magnitude and phase in the device reference plane with timeout.</summary>
 /// <param name="iTuner">Specifies a reference to the instrument.</param>
 /// <param name="phaseVswr">Specifies the desired voltage standing wave ratio (VSWR) and phase of the reflection coefficient.</param>
 /// <param name="timeout">Specifies the maximum length of time, in seconds, to allow the operation to complete. The default is 60.</param>
 /// <returns>The estimated voltage standing wave ratio (VSWR) and the associated phase at the device reference plane for the current tuner position at all frequencies of the active tuner calibration data set.</returns>
 public static PhaseVSWR[] MoveTunerPerVSWR(FocusITunerBroker iTuner, PhaseVSWR phaseVswr, short timeout = 60)
 {
     iTuner.MoveTunerPerVSWR(phaseVswr);
     iTuner.WaitForOperationComplete(timeout);
     return(iTuner.QueryVSWRAllFrequencies());
 }
Пример #6
0
 /// <summary>Sets the specified reflection coefficient in the device reference plane at fundamental frequency with timeout.</summary>
 /// <param name="iTuner">Specifies a reference to the instrument.</param>
 /// <param name="gamma">Specifies the desired reflection coefficient in the device reference plane. Valid Range is Real part: [-1, 1] and Imaginary part: [-1, 1].</param>
 /// <param name="timeout">Specifies the maximum length of time, in seconds, to allow the operation to complete. The default is 60.</param>
 /// <returns>The estimated reflection coefficient at the device reference plane for the current tuner position at all frequencies of the active tuner calibration data set.</returns>
 public static Complex[] MoveTunerPerGamma(FocusITunerBroker iTuner, Complex gamma, short timeout = 60)
 {
     iTuner.MoveTunerPerReflectionCoefficient(gamma);
     iTuner.WaitForOperationComplete(timeout);
     return(iTuner.QueryReflectionCoefficientAllFrequencies());
 }