From 4eb862408081a48bf127a0eb251266592c1cf9c2 Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 7 Oct 2026 19:45:14 +0530 Subject: [PATCH 1/9] Add @Avinash2Suresh as a code owner --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 17a4e6de4d..dac883d426 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @marcoskirsch @ni-jfitzger @vnktshr21 +* @marcoskirsch @ni-jfitzger @vnktshr21 @Avinash2Suresh From cdf7fa8a8f55a73187c19530cb86b2ca1a7425df Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Thu, 8 Oct 2026 16:12:42 +0530 Subject: [PATCH 2/9] add: add Improve DC Noise Rejection example for nidmm --- CHANGELOG.md | 1 + docs/nidmm/examples.rst | 9 ++++ .../nidmm_improve_dc_noise_rejection.py | 52 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 src/nidmm/examples/nidmm_improve_dc_noise_rejection.py diff --git a/CHANGELOG.md b/CHANGELOG.md index de3f196dcb..2bc7a225f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -799,6 +799,7 @@ #### [nidmm] Unreleased - Added - (Common) Added `nitlsconfig[grpc]>=1.0.0a2` to the optional gRPC dependencies. + - Added `nidmm_improve_dc_noise_rejection.py`, a multipoint measurement example with configurable aperture time and DC noise rejection. - Changed - Removed diff --git a/docs/nidmm/examples.rst b/docs/nidmm/examples.rst index 972a1dbc9e..39bb016394 100644 --- a/docs/nidmm/examples.rst +++ b/docs/nidmm/examples.rst @@ -12,6 +12,15 @@ nidmm_fetch_waveform.py :encoding: utf8 :caption: `(nidmm_fetch_waveform.py) `_ +nidmm_improve_dc_noise_rejection.py +----------------------------------- + +.. literalinclude:: ../../src/nidmm/examples/nidmm_improve_dc_noise_rejection.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nidmm_improve_dc_noise_rejection.py) `_ + nidmm_measurement.py -------------------- diff --git a/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py new file mode 100644 index 0000000000..a5c3b56642 --- /dev/null +++ b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py @@ -0,0 +1,52 @@ +#!/usr/bin/python + +import argparse +import nidmm +import sys + + +def example(resource_name, options, function, range, digits, aperture_time, dc_noise_rejection, sample_count, auto_zero='OFF'): + with nidmm.Session(resource_name=resource_name, options=options) as session: + session.configure_measurement_digits(measurement_function=nidmm.Function[function], range=range, resolution_digits=digits) + session.configure_multi_point(trigger_count=1, sample_count=sample_count) + session.auto_zero = nidmm.AutoZero[auto_zero] + session.aperture_time_units = nidmm.ApertureTimeUnits.SECONDS + session.aperture_time = aperture_time + session.dc_noise_rejection = nidmm.DCNoiseRejection[dc_noise_rejection] + measurements = session.read_multi_point(array_size=sample_count) + print('Measurements: ', measurements) + + +def _main(argsv): + supported_functions = list(nidmm.Function.__members__.keys()) + supported_noise_rejection_modes = list(nidmm.DCNoiseRejection.__members__.keys()) + parser = argparse.ArgumentParser(description='Performs a multipoint measurement with improved DC noise rejection using the NI-DMM API.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='PXI1Slot2', help='Resource name of an NI digital multimeter.') + parser.add_argument('-op', '--option-string', default='', type=str, help='Option string') + parser.add_argument('-f', '--function', default='DC_VOLTS', choices=supported_functions, type=str.upper, help='Measurement function.') + parser.add_argument('-r', '--range', default=0.1, type=float, help='Measurement range.') + parser.add_argument('-d', '--digits', default=6.5, type=float, help='Digits of resolution for the measurement.') + parser.add_argument('--auto-zero', default='OFF', choices=nidmm.AutoZero.__members__.keys(), type=str.upper, help='AutoZero mode.') + parser.add_argument('-a', '--aperture-time', default=0.1, type=float, help='Measurement aperture time in seconds.') + parser.add_argument('--dc-noise-rejection', default='NORMAL', choices=supported_noise_rejection_modes, type=str.upper, help='DC noise rejection mode.') + parser.add_argument('-s', '--sample-count', default=10, type=int, help='The number of measurements the DMM makes.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.function, args.range, args.digits, args.aperture_time, args.dc_noise_rejection, args.sample_count, args.auto_zero) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = {'simulate': True, 'driver_setup': {'Model': '4082', 'BoardType': 'PXI', }, } + example('PXI1Slot2', options, 'DC_VOLTS', 0.1, 6.5, 0.1, 'NORMAL', 10, 'OFF') + + +def test_main(): + cmd_line = ['--option-string', 'Simulate=1, DriverSetup=Model:4082; BoardType:PXI', '--auto-zero', 'ON', ] + _main(cmd_line) + + +if __name__ == '__main__': + main() From c965114b16879bdd192fc0abf6140a854fc8f83e Mon Sep 17 00:00:00 2001 From: Divakar Date: Thu, 8 Oct 2026 16:17:45 +0530 Subject: [PATCH 3/9] Remove @Avinash2Suresh from CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dac883d426..17a4e6de4d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @marcoskirsch @ni-jfitzger @vnktshr21 @Avinash2Suresh +* @marcoskirsch @ni-jfitzger @vnktshr21 From b12451de8a859b66ce7ff2d03f76325c06d1d011 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Thu, 8 Oct 2026 16:45:53 +0530 Subject: [PATCH 4/9] fix: fix tests --- src/nidmm/examples/nidmm_improve_dc_noise_rejection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py index a5c3b56642..c250e938ca 100644 --- a/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py +++ b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py @@ -39,12 +39,12 @@ def main(): def test_example(): - options = {'simulate': True, 'driver_setup': {'Model': '4082', 'BoardType': 'PXI', }, } + options = {'simulate': True, 'driver_setup': {'Model': '4082', 'BoardType': 'PXIe', }, } example('PXI1Slot2', options, 'DC_VOLTS', 0.1, 6.5, 0.1, 'NORMAL', 10, 'OFF') def test_main(): - cmd_line = ['--option-string', 'Simulate=1, DriverSetup=Model:4082; BoardType:PXI', '--auto-zero', 'ON', ] + cmd_line = ['--option-string', 'Simulate=1, DriverSetup=Model:4082; BoardType:PXIe', ] _main(cmd_line) From 944eda7f54ccad7c57c6d03a25081b300f640e24 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Fri, 9 Oct 2026 09:15:45 +0530 Subject: [PATCH 5/9] Trigger CI build From f97bec31137f20d9a6de20ebf62aa2049dc117d1 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Fri, 9 Oct 2026 17:37:26 +0530 Subject: [PATCH 6/9] resolve PR comments --- CHANGELOG.md | 2 +- .../nidmm_improve_dc_noise_rejection.py | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c897d53ac0..9910c6ffcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -799,8 +799,8 @@ #### [nidmm] Unreleased - Added - Added the `nidmm_measure_ac_volts.py` example. + - Added the `nidmm_improve_dc_noise_rejection.py` example. - (Common) Added `nitlsconfig[grpc]>=1.0.0a2` to the optional gRPC dependencies. - - Added `nidmm_improve_dc_noise_rejection.py`, a multipoint measurement example with configurable aperture time and DC noise rejection. - Changed - Removed diff --git a/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py index b440d71248..cf19ac7aeb 100644 --- a/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py +++ b/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py @@ -5,7 +5,7 @@ import sys -def example(resource_name, options, function, range, digits, aperture_time, dc_noise_rejection, sample_count, auto_zero='OFF'): +def example(resource_name, options, function, range, digits, aperture_time, dc_noise_rejection, sample_count, auto_zero): with nidmm.Session(resource_name=resource_name, options=options) as session: session.configure_measurement_digits(measurement_function=nidmm.Function[function], range=range, resolution_digits=digits) session.configure_multi_point(trigger_count=1, sample_count=sample_count) @@ -14,22 +14,22 @@ def example(resource_name, options, function, range, digits, aperture_time, dc_n session.aperture_time = aperture_time session.dc_noise_rejection = nidmm.DCNoiseRejection[dc_noise_rejection] measurements = session.read_multi_point(array_size=sample_count) - print('Measurements: ', measurements) + print(f'Measurements for {sample_count} Samples: {measurements}') def _main(argsv): supported_functions = list(nidmm.Function.__members__.keys()) supported_noise_rejection_modes = list(nidmm.DCNoiseRejection.__members__.keys()) - parser = argparse.ArgumentParser(description='Performs a multipoint measurement with improved DC noise rejection using the NI-DMM API.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('-n', '--resource-name', default='PXI1Slot2', help='Resource name of an NI digital multimeter.') - parser.add_argument('-op', '--option-string', default='', type=str, help='Option string') - parser.add_argument('-f', '--function', default='DC_VOLTS', choices=supported_functions, type=str.upper, help='Specifies the measurement function.') - parser.add_argument('-r', '--range', default=0.1, type=float, help='Specifies the measurement range. Use positive values to represent the absolute value of the maximum expected measurement, in units appropriate for the measurement function (for example, volts for DC_VOLTS).') - parser.add_argument('-d', '--digits', default=6.5, type=float, help='Specifies the measurement resolution in digits. Higher values increase measurement accuracy; lower values increase measurement speed. The aperture time below overrides the default aperture selected by this setting.') - parser.add_argument('--auto-zero', default='OFF', choices=nidmm.AutoZero.__members__.keys(), type=str.upper, help='Specifies the AutoZero mode. AUTO: the driver chooses based on the function and resolution. OFF: AutoZero is disabled. ON: the DMM takes a zero reading after each measurement and subtracts it from the preceding reading. ONCE: the DMM takes a zero reading for the first measurement and subtracts it from all readings.') - parser.add_argument('-a', '--aperture-time', default=0.1, type=float, help='Specifies the measurement aperture time in seconds. It is applied after the measurement is configured, overriding the default aperture.') - parser.add_argument('--dc-noise-rejection', default='NORMAL', choices=supported_noise_rejection_modes, type=str.upper, help='Specifies the DC noise rejection mode. AUTO: the driver chooses based on the function and resolution. NORMAL: all samples are weighted equally. SECOND_ORDER: samples in the middle of the aperture time are weighted more than those at the ends, using a triangular weighting function. HIGH_ORDER: the same, using a bell-curve weighting function. Not supported on the NI 4050 and NI 4060.') - parser.add_argument('-s', '--sample-count', default=10, type=int, help='Specifies the number of measurements the DMM takes in the multiple point acquisition.') + parser = argparse.ArgumentParser(description='Performs a multipoint DC voltage measurement with configurable DC noise rejection.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='PXI1Slot2', help='Contains the resource_name of the device to initialize.') + parser.add_argument('-op', '--option-string', default='', type=str, help='Sets the initial value of certain attributes for the session.') + parser.add_argument('-f', '--function', default='DC_VOLTS', choices=supported_functions, type=str.upper, help='Specifies the measurement_function used to acquire the measurement.') + parser.add_argument('-r', '--range', default=0.1, type=float, help='Specifies the range for the function specified in the Measurement_Function parameter.') + parser.add_argument('-d', '--digits', default=6.5, type=float, help='Specifies the resolution of the measurement in digits.') + parser.add_argument('--auto-zero', default='OFF', choices=nidmm.AutoZero.__members__.keys(), type=str.upper, help='Specifies the AutoZero mode.') + parser.add_argument('-a', '--aperture-time', default=0.1, type=float, help='Specifies the measurement aperture time for the current configuration, in seconds.') + parser.add_argument('--dc-noise-rejection', default='NORMAL', choices=supported_noise_rejection_modes, type=str.upper, help='Specifies the DC noise rejection mode.') + parser.add_argument('-s', '--sample-count', default=10, type=int, help='Specifies the number of measurements the DMM takes each time it receives a trigger in a multiple point acquisition.') args = parser.parse_args(argsv) example(args.resource_name, args.option_string, args.function, args.range, args.digits, args.aperture_time, args.dc_noise_rejection, args.sample_count, args.auto_zero) From eeb488228519f9b457d55cf626b3d4c2f760f26a Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Fri, 9 Oct 2026 18:06:22 +0530 Subject: [PATCH 7/9] Trigger CI build From 5b30a8757c8a47407ed0d96194883f3095b6d9f3 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Fri, 9 Oct 2026 20:17:50 +0530 Subject: [PATCH 8/9] Trigger CI build From a39ffd070f29747cdecf81881c721ad52b676a26 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Fri, 9 Oct 2026 21:27:03 +0530 Subject: [PATCH 9/9] Trigger CI build