public static void ApplyPinTDROffset(NIDigital nIDigital, string pinName, double cableDelay_s)
 {
     //Create a new PrecisionTimeSpan array with the cable delay value
     PrecisionTimeSpan[] offsets = new PrecisionTimeSpan[1] {
         PrecisionTimeSpan.FromSeconds(cableDelay_s)
     };
     nIDigital.PinAndChannelMap.GetPinSet(pinName).ApplyTdrOffsets(offsets);
 }
Beispiel #2
0
        public AnalogWaveformCollection <double> Sample()
        {
            AnalogWaveformCollection <double> waveforms = null;

            ScopeSession.Measurement.Initiate();
            waveforms = ScopeSession.Channels[_channelList].Measurement.FetchDouble(PrecisionTimeSpan.FromSeconds(-1),
                                                                                    _recordLengthMin, waveforms);
            return(waveforms);
        }
        public void writeWaveform(ComplexWaveform <ComplexDouble> IQdata) //input is complex waveform that was created using createWaveform(offsets);
        {
            //rest of code to write offsets
            ComplexWaveform <ComplexDouble> NewIQData = new ComplexWaveform <ComplexDouble>(numSamples);
            //List<PhaseAmplitudeOffset> offsetList = new List<PhaseAmplitudeOffset>();

            PrecisionTimeSpan dt = PrecisionTimeSpan.FromSeconds(1 / actualIQRate);

            IQdata.PrecisionTiming = PrecisionWaveformTiming.CreateWithRegularInterval(dt);
            _rfsgSession.Arb.WriteWaveform("", IQdata);
            _rfsgSession.Initiate();

            //ComplexWaveform<ComplexDouble> IQdata
        }
        public static MeasurementResults MeasureChannel(NIScope scope, string channelName = "0")
        {
            MeasurementResults results = new MeasurementResults();

            scope.Measurement.Initiate();
            AnalogWaveformCollection <double> resultWaveform = new AnalogWaveformCollection <double>();

            resultWaveform         = scope.Channels[channelName].Measurement.FetchDouble(PrecisionTimeSpan.FromSeconds(5), -1, null);
            results.ResultsTrace   = resultWaveform[0].GetRawData();
            results.AverageValue_V = scope.Channels[channelName].Measurement.FetchScalarMeasurement(PrecisionTimeSpan.FromSeconds(5),
                                                                                                    ScopeScalarMeasurementType.VoltageAverage)[0];
            scope.Measurement.Abort();

            return(results);
        }