/// <summary>Applies common instrument settings to the analyzer.</summary>
 /// <param name="instrHandle">The open RFmx Instr session to configure.</param>
 /// <param name="instrConfig">The instrument configuration properties to apply.</param>
 public static void ConfigureInstrument(RFmxInstrMX instrHandle, InstrumentConfiguration instrConfig)
 {
     instrHandle.SetFrequencyReferenceSource("", instrConfig.FrequencyReferenceSource);
     instrHandle.GetInstrumentModel("", out string model);
     // Only configure LO settings on supported VSTs
     if (Regex.IsMatch(model, "NI PXIe-58[34].")) // Matches 583x and 584x VST families
     {
         if (instrConfig.LOSharingMode == LocalOscillatorSharingMode.None)
         {
             instrHandle.ConfigureAutomaticSGSASharedLO("", RFmxInstrMXAutomaticSGSASharedLO.Disabled);
         }
         else
         {
             instrHandle.ConfigureAutomaticSGSASharedLO("", RFmxInstrMXAutomaticSGSASharedLO.Enabled);
             // Configure automatic LO offsetting
             instrHandle.SetLOLeakageAvoidanceEnabled("", RFmxInstrMXLOLeakageAvoidanceEnabled.True);
             instrHandle.ResetAttribute("", RFmxInstrMXPropertyId.DownconverterFrequencyOffset);
         }
     }
 }
Ejemplo n.º 2
0
        public static void ConfigureCommon(RFmxInstrMX sessionHandle, RFmxWlanMX wlanSignal, CommonConfiguration commonConfig,
                                           AutoLevelConfiguration autoLevelConfig, string selectorString = "")
        {
            string instrModel;

            sessionHandle.ConfigureFrequencyReference("", commonConfig.FrequencyReferenceSource, 10e6);
            sessionHandle.GetInstrumentModel("", out instrModel);

            sessionHandle.SetLOSource("", commonConfig.LOSource);
            sessionHandle.SetDownconverterFrequencyOffset("", commonConfig.LOOffset);

            wlanSignal.ConfigureDigitalEdgeTrigger(selectorString, commonConfig.DigitalEdgeSource, commonConfig.DigitalEdgeType, commonConfig.TriggerDelay_s, commonConfig.EnableTrigger);
            wlanSignal.ConfigureFrequency(selectorString, commonConfig.CenterFrequency_Hz);
            wlanSignal.ConfigureExternalAttenuation(selectorString, commonConfig.ExternalAttenuation_dB);

            if (autoLevelConfig.AutoLevelReferenceLevel)
            {
                wlanSignal.AutoLevel(selectorString, autoLevelConfig.AutoLevelMeasureTime_s);
            }
            else
            {
                wlanSignal.ConfigureReferenceLevel(selectorString, commonConfig.ReferenceLevel_dBm);
            }
        }