private void ApplyAutomaticLOConfiguration(NIRfsg rfsg, RFmxInstrMX instr) { SG.InstrumentConfiguration sgConfig = SG.InstrumentConfiguration.GetDefault(rfsg); SG.ConfigureInstrument(rfsg, sgConfig); RFmxInstr.InstrumentConfiguration instrConfig = RFmxInstr.InstrumentConfiguration.GetDefault(); RFmxInstr.ConfigureInstrument(instr, instrConfig); }
private void ApplyNoLOSharingConfiguration(NIRfsg rfsg, RFmxInstrMX instr) { SG.InstrumentConfiguration sgConfig = SG.InstrumentConfiguration.GetDefault(rfsg); sgConfig.LOSharingMode = LocalOscillatorSharingMode.None; SG.ConfigureInstrument(rfsg, sgConfig); RFmxInstr.InstrumentConfiguration instrConfig = RFmxInstr.InstrumentConfiguration.GetDefault(); instrConfig.LOSharingMode = LocalOscillatorSharingMode.None; RFmxInstr.ConfigureInstrument(instr, instrConfig); }
public override Task <Empty> ConfigureInstrument(RFmxInstrumentConfiguration request, ServerCallContext context) { var instr = sessionMap[(IntPtr)request.Session.Handle]; RFmxInstr.ConfigureInstrument(instr, new RFmxInstr.InstrumentConfiguration() { FrequencyReferenceSource = request.FrequencyReferenceSource, LOSharingMode = (LocalOscillatorSharingMode)request.LOSharingMode }); return(Task.FromResult(new Empty())); }
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; }