Beispiel #1
0
 /// <summary>Configures common instrument settings for the envelope generator.</summary>
 /// <param name="envVsg">The open RFSG session to configure.</param>
 /// <param name="envVsgConfig">The common settings to apply to the envelope generator.</param>
 /// <param name="trackerConfig">The common settings pertaining to the tracker that is used to modulate the power supply voltage.</param>
 public static void ConfigureEnvelopeGenerator(NIRfsg envVsg, EnvelopeGeneratorConfiguration envVsgConfig, TrackerConfiguration trackerConfig)
 {
     // all function calls assume a differential terminal configuration since that is the only option supported by the PXIe-5820
     envVsg.FrequencyReference.Source           = RfsgFrequencyReferenceSource.FromString(envVsgConfig.ReferenceClockSource);
     envVsg.IQOutPort[""].LoadImpedance         = trackerConfig.InputImpedance_Ohms == 50.0 ? 100.0 : trackerConfig.InputImpedance_Ohms;
     envVsg.IQOutPort[""].TerminalConfiguration = RfsgTerminalConfiguration.Differential;
     envVsg.IQOutPort[""].CommonModeOffset      = trackerConfig.CommonModeOffset_V;
 }
        /// <summary>
        /// This example illustrates how to use RFSG drivers and envelope tracking APIs to configure envelope tracking.
        /// </summary>
        static void Main(string[] args)
        {
            #region Example Settings
            // Select mode for use in the example
            EnvelopeMode mode         = EnvelopeMode.Detrough;
            string       waveformPath = @"C:\Users\Public\Documents\National Instruments\RFIC Test Software\Waveforms\LTE_FDD_DL_1x20MHz_TM11_OS4.tdms";
            #endregion

            #region Configure RF Generator
            // Initialize instrument sessions
            NIRfsg rfVsg = new NIRfsg("5840", true, false);

            // Load up waveform
            Waveform rfWfm = LoadWaveformFromTDMS(waveformPath);

            // Configure RF generator
            InstrumentConfiguration rfInstrConfig = InstrumentConfiguration.GetDefault();
            ConfigureInstrument(rfVsg, rfInstrConfig);
            DownloadWaveform(rfVsg, rfWfm);
            ConfigureContinuousGeneration(rfVsg, rfWfm);
            #endregion

            #region Configure Tracker Generator
            NIRfsg envVsg = new NIRfsg("5820", true, false);

            // Configure envelope generator
            EnvelopeGeneratorConfiguration envInstrConfig = EnvelopeGeneratorConfiguration.GetDefault();
            TrackerConfiguration           trackerConfig  = TrackerConfiguration.GetDefault();
            ConfigureEnvelopeGenerator(envVsg, envInstrConfig, trackerConfig);

            Waveform envWfm = new Waveform();
            switch (mode)
            {
            case EnvelopeMode.Detrough:
                // Create envelope waveform
                DetroughConfiguration detroughConfig = DetroughConfiguration.GetDefault();
                detroughConfig.MinimumVoltage_V = 1.5;
                detroughConfig.MaximumVoltage_V = 3.5;
                detroughConfig.Exponent         = 1.2;
                detroughConfig.Type             = DetroughType.Exponential;
                envWfm = CreateDetroughEnvelopeWaveform(rfWfm, detroughConfig);
                break;

            case EnvelopeMode.LUT:
                LookUpTableConfiguration lutConfig = new LookUpTableConfiguration
                {
                    DutAverageInputPower_dBm = rfInstrConfig.DutAverageInputPower_dBm
                };
                // Todo - initialize lookup table
                envWfm = CreateLookUpTableEnvelopeWaveform(rfWfm, lutConfig);
                break;
            }

            ScaleAndDownloadEnvelopeWaveform(envVsg, envWfm, trackerConfig);
            ConfigureContinuousGeneration(envVsg, envWfm, "PFI0");
            #endregion

            // Start envelope tracking
            SynchronizationConfiguration syncConfig = SynchronizationConfiguration.GetDefault();
            InitiateSynchronousGeneration(rfVsg, envVsg, syncConfig);

            // Wait until user presses a button to stop
            Console.WriteLine("Press any key to abort envelope tracking..");
            Console.ReadKey();

            AbortGeneration(envVsg);
            AbortGeneration(rfVsg);

            // Close instruments
            rfVsg.Close();
            envVsg.Close();
        }