예제 #1
0
        /// <summary>Configures common instrument settings for generation.</summary>
        /// <param name="rfsgHandle">The open RFSG session to configure.</param>
        /// <param name="instrConfig">The common instrument settings to configure.</param>
        public static void ConfigureInstrument(NIRfsg rfsgHandle, InstrumentConfiguration instrConfig)
        {
            rfsgHandle.SignalPath.SelectedPorts = instrConfig.SelectedPorts;
            rfsgHandle.RF.ExternalGain          = -instrConfig.ExternalAttenuation_dB;
            rfsgHandle.RF.Configure(instrConfig.CarrierFrequency_Hz, instrConfig.DutAverageInputPower_dBm);

            rfsgHandle.FrequencyReference.Source = RfsgFrequencyReferenceSource.FromString(instrConfig.ReferenceClockSource);

            // Only configure LO settings on supported VSTs
            if (Regex.IsMatch(rfsgHandle.Identity.InstrumentModel, "NI PXIe-58[34].")) // Matches 583x and 584x VST families
            {
                IntPtr rfsgPtr = rfsgHandle.GetInstrumentHandle().DangerousGetHandle();
                NIRfsgPlayback.RetrieveAutomaticSGSASharedLO(rfsgPtr, "", out RfsgPlaybackAutomaticSGSASharedLO currentMode);
                if (instrConfig.LOSharingMode == LocalOscillatorSharingMode.None && currentMode != RfsgPlaybackAutomaticSGSASharedLO.Disabled)
                {
                    //Setting this property resets other settings, which can create issues. Hence, it is only set if the value
                    //is different than the current mode.
                    NIRfsgPlayback.StoreAutomaticSGSASharedLO(rfsgPtr, "", RfsgPlaybackAutomaticSGSASharedLO.Disabled);
                }
                else if (instrConfig.LOSharingMode == LocalOscillatorSharingMode.Automatic && currentMode != RfsgPlaybackAutomaticSGSASharedLO.Enabled)
                {
                    //Setting this property resets other settings, which can create issues. Hence, it is only set if the value
                    //is different than the current mode.
                    NIRfsgPlayback.StoreAutomaticSGSASharedLO(rfsgPtr, "", RfsgPlaybackAutomaticSGSASharedLO.Enabled);
                }
            }
            //Do nothing; any configuration for LOs with standalone VSGs should be configured manually.
            //Baseband instruments don't have LOs. Unsupported VSTs must be configured manually.
        }
예제 #2
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;
 }
        public static void ConfigureInstrument(ref NIRfsg rfsgHandle, InstrumentConfiguration instrConfig)
        {
            rfsgHandle.Arb.GenerationMode = RfsgWaveformGenerationMode.Script;
            rfsgHandle.RF.PowerLevelType  = RfsgRFPowerLevelType.PeakPower;

            rfsgHandle.RF.ExternalGain = -instrConfig.ExternalAttenuation_dBm;
            rfsgHandle.RF.Configure(instrConfig.CarrierFrequency_Hz, instrConfig.AverageInputPower_dBm);

            rfsgHandle.FrequencyReference.Source = RfsgFrequencyReferenceSource.FromString(instrConfig.ReferenceClockSource);
            rfsgHandle.DeviceEvents.MarkerEvents[0].ExportedOutputTerminal =
                RfsgMarkerEventExportedOutputTerminal.FromString(instrConfig.BurstStartTriggerExportTerminal);

            if (instrConfig.ShareLOSGToSA)
            {
                rfsgHandle.RF.LocalOscillator.LOOutEnabled = true;
                rfsgHandle.RF.LocalOscillator.Source       = RfsgLocalOscillatorSource.Onboard;
            }
        }
        public static void ConfigureInstrument(NIRfsg rfsgHandle, InstrumentConfiguration instrConfig)
        {
            rfsgHandle.RF.ExternalGain = -instrConfig.ExternalAttenuation_dBm;
            rfsgHandle.RF.Configure(instrConfig.CarrierFrequency_Hz, instrConfig.DutAverageInputPower_dBm);

            rfsgHandle.FrequencyReference.Source = RfsgFrequencyReferenceSource.FromString(instrConfig.ReferenceClockSource);

            if (instrConfig.ShareLOSGToSA)
            {
                rfsgHandle.RF.LocalOscillator.LOOutEnabled = true;
                rfsgHandle.RF.LocalOscillator.Source       = RfsgLocalOscillatorSource.Onboard;
            }
            else
            {
                rfsgHandle.RF.LocalOscillator.LOOutEnabled = false;
                // Return to the default value, in case in future modifications the above case changes
                // this to something other than the default
                rfsgHandle.RF.LocalOscillator.Source = RfsgLocalOscillatorSource.Onboard;
            }
        }