public static void ConfigureCommon(ref RFmxInstrMX sessionHandle, ref RFmxSpecAnMX specAnSignal, CommonConfiguration commonConfig, AutoLevelConfiguration autoLevelConfig, string selectorString = "") { sessionHandle.ConfigureFrequencyReference("", commonConfig.FrequencyReferenceSource, 10e6); sessionHandle.SetLOSource("", commonConfig.LOSource); sessionHandle.SetDownconverterFrequencyOffset("", commonConfig.LOOffset); specAnSignal.ConfigureDigitalEdgeTrigger(selectorString, commonConfig.DigitalEdgeSource, commonConfig.DigitalEdgeType, commonConfig.TriggerDelay_s, commonConfig.EnableTrigger); specAnSignal.ConfigureFrequency(selectorString, commonConfig.CenterFrequency_Hz); specAnSignal.Spectrum.Configuration.ConfigureSpan(selectorString, commonConfig.Span_Hz); specAnSignal.ConfigureExternalAttenuation(selectorString, commonConfig.ExternalAttenuation_dB); if (autoLevelConfig.AutoLevelReferenceLevel) { specAnSignal.AutoLevel(selectorString, commonConfig.Span_Hz, autoLevelConfig.AutoLevelMeasureTime_s, out _); } else { specAnSignal.ConfigureReferenceLevel(selectorString, commonConfig.ReferenceLevel_dBm); } }
private void ConfigureSpecAn() { /* Get SpecAn signal */ specAn = instrSession.GetSpecAnSignalConfiguration(); specAn.ConfigureFrequency("", centerFrequency); instrSession.ConfigureFrequencyReference("", frequencySource, frequency); specAn.SetSelectedPorts("", selectedPorts); specAn.ConfigureReferenceLevel("", referenceLevel); specAn.ConfigureExternalAttenuation("", externalAttenuation); instrSession.ConfigureRFAttenuation("", rfAttenuationAuto, rfAttenuation); specAn.SelectMeasurements("", RFmxSpecAnMXMeasurementTypes.IM, enableAllTraces); specAn.IM.Configuration.ConfigureAveraging("", averagingEnabled, averagingCount, averagingType); specAn.IM.Configuration.ConfigureRbwFilter("", rbwAuto, rbw, rbwFilterType); specAn.IM.Configuration.ConfigureSweepTime("", sweepTimeAuto, sweepTimeInterval); specAn.IM.Configuration.ConfigureFft("", fftWindow, fftPadding); specAn.IM.Configuration.ConfigureMeasurementMethod("", measurementMethod); specAn.IM.Configuration.ConfigureFundamentalTones("", lowerToneFrequency, upperToneFrequency); specAn.IM.Configuration.ConfigureAutoIntermodsSetup("", autoIntermodsSetupEnabled, maximumIntermodOrder); specAn.Initiate("", ""); }