private void ConfigureNR()
        {
            watch.Start();

            NR_offsets = instrSession.GetNRSignalConfiguration("signal::offsets");
            NR_carrier = instrSession.GetNRSignalConfiguration("signal::carrier");

            instrSession.ConfigureFrequencyReference("", frequencyReferenceSource, frequencyReferenceFrequency);
            instrSession.SetDownconverterFrequencyOffset("signal::carrier", 256e6);

            //Configure offset measurements
            NR_offsets.SetSelectedPorts("", selectedPorts);
            NR_offsets.ConfigureRF("", centerFrequency, referenceLevel, externalAttenuation);
            NR_offsets.ConfigureDigitalEdgeTrigger("", digitalEdgeSource, digitalEdge, triggerDelay, enableTrigger);
            NR_offsets.SetLinkDirection("", linkDirection);
            NR_offsets.SetFrequencyRange("", frequencyRange);
            NR_offsets.SetBand("", modaccBand);
            NR_offsets.ComponentCarrier.SetBandwidth("", carrierBandwidth);
            NR_offsets.ComponentCarrier.SetBandwidthPartSubcarrierSpacing("", subcarrierSpacing);
            NR_offsets.SelectMeasurements("", RFmxNRMXMeasurementTypes.Acp | RFmxNRMXMeasurementTypes.Sem, true);


            //Configure carrier measurements
            NR_carrier.SetSelectedPorts("", selectedPorts);
            NR_carrier.ConfigureRF("", centerFrequency, referenceLevel, externalAttenuation);
            NR_carrier.ConfigureDigitalEdgeTrigger("", digitalEdgeSource, digitalEdge, triggerDelay, enableTrigger);
            NR_carrier.SetLinkDirection("", linkDirection);
            NR_carrier.SetFrequencyRange("", frequencyRange);
            NR_carrier.SetBand("", modaccBand);
            NR_carrier.ComponentCarrier.SetBandwidth("", carrierBandwidth);
            NR_carrier.ComponentCarrier.SetBandwidthPartSubcarrierSpacing("", subcarrierSpacing);
            NR_carrier.SelectMeasurements("", RFmxNRMXMeasurementTypes.ModAcc | RFmxNRMXMeasurementTypes.Chp | RFmxNRMXMeasurementTypes.Obw, true);

            NR_offsets.Acp.Configuration.ConfigureSweepTime("", RFmxNRMXAcpSweepTimeAuto.True, sweepTimeInterval);

            NR_offsets.Chp.Configuration.ConfigureSweepTime("", RFmxNRMXChpSweepTimeAuto.True, sweepTimeInterval);

            NR_offsets.Obw.Configuration.ConfigureSweepTime("", RFmxNRMXObwSweepTimeAuto.True, sweepTimeInterval);

            NR_offsets.Sem.Configuration.ConfigureSweepTime("", RFmxNRMXSemSweepTimeAuto.True, sweepTimeInterval);

            NR_carrier.ModAcc.Configuration.SetAveragingEnabled("", RFmxNRMXModAccAveragingEnabled.False);
            NR_carrier.ModAcc.Configuration.SetAveragingCount("", averagingCount);

            NR_offsets.Acp.Configuration.ConfigureAveraging("", RFmxNRMXAcpAveragingEnabled.False, averagingCount,
                                                            RFmxNRMXAcpAveragingType.Rms);

            NR_carrier.Chp.Configuration.ConfigureAveraging("", RFmxNRMXChpAveragingEnabled.False, averagingCount,
                                                            RFmxNRMXChpAveragingType.Rms);

            NR_carrier.Obw.Configuration.ConfigureAveraging("", RFmxNRMXObwAveragingEnabled.False, averagingCount,
                                                            RFmxNRMXObwAveragingType.Rms);

            NR_offsets.Sem.Configuration.ConfigureAveraging("", RFmxNRMXSemAveragingEnabled.False, averagingCount,
                                                            RFmxNRMXSemAveragingType.Rms);

            NR_carrier.ModAcc.Configuration.SetMeasurementLengthUnit("", measurementLengthUnit);
            NR_carrier.ModAcc.Configuration.SetMeasurementOffset("", measurementOffset);
            NR_carrier.ModAcc.Configuration.SetMeasurementLength("", measurementLength);

            if (linkDirection == RFmxNRMXLinkDirection.Uplink)
            {
                NR_offsets.Sem.Configuration.ConfigureUplinkMaskType("", uplinkMaskType);
            }
            else
            {
                NR_offsets.ConfiguregNodeBCategory("", gNodeBCategory);
                NR_offsets.Sem.Configuration.SetDownlinkMaskType("", downlinkMaskType);
                NR_offsets.Sem.Configuration.SetDeltaFMaximum("", deltaFMaximum);
                NR_offsets.Sem.Configuration.ComponentCarrier.ConfigureRatedOutputPower("", componentCarrierRatedOutputPower);
            }
            NR_offsets.Commit("");
            NR_carrier.Commit("");
            offsetResults  = RFmxNRMX.BuildResultString("offsetResults");
            carrierResults = RFmxNRMX.BuildResultString("carrierResults");
            NR_carrier.Initiate("", "carrierResults");
            instrSession.WaitForAcquisitionComplete(timeout);
            NR_offsets.Initiate("", "offsetResults");
            //NR_offsets.WaitForMeasurementComplete("", timeout);
//            NR_carrier.Initiate("", "");
        }