Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4eb8624
Add @Avinash2Suresh as a code owner
NI-velmurugan Oct 7, 2026
79d0b7e
Merge branch 'master' of https://github.com/NI-velmurugan/nimi-python
divakar-selvam07 Oct 12, 2026
8305ba2
Remove @Avinash2Suresh from CODEOWNERS
divakar-selvam07 Oct 8, 2026
060842c
add: add Max DC Reading Rate at 7.5 Digits example
divakar-selvam07 Oct 20, 2026
eacc6d0
Trigger CI build
divakar-selvam07 Oct 20, 2026
09025cd
Refine nidmm 7.5 digit reading rate example
divakar-selvam07 Oct 21, 2026
c9a813b
Trigger CI build
divakar-selvam07 Oct 21, 2026
93e5cad
Trigger CI build
divakar-selvam07 Oct 21, 2026
817ace3
Fix sample guard in 7.5-digit example
divakar-selvam07 Oct 22, 2026
4d1dee6
Merge branch 'master' of https://github.com/ni/nimi-python into users…
divakar-selvam07 Oct 26, 2026
9262017
Regenerate nirfsa enum documentation
divakar-selvam07 Oct 26, 2026
8577067
Remove plotting from nidmm reading rate example
divakar-selvam07 Nov 2, 2026
02b5bcc
Trigger CI build
divakar-selvam07 Nov 2, 2026
63cd074
Merge branch 'master' of https://github.com/ni/nimi-python into users…
divakar-selvam07 Nov 2, 2026
65afb08
Regenerate NI-DMM examples.rst via codegen
divakar-selvam07 Nov 2, 2026
53ef73d
Merge upstream master into NI-DMM max DC reading rate example branch
divakar-selvam07 Nov 3, 2026
8aa3e67
Merge latest upstream master into NI-DMM max DC reading rate example …
divakar-selvam07 Nov 3, 2026
e3a3ee1
Trigger CI build
divakar-selvam07 Nov 3, 2026
1a2ee27
Trigger CI build
divakar-selvam07 Nov 4, 2026
fe91c39
Merge branch 'master' into users/diva/add-nidmm-max-dc-reading-rate-a…
divakar-selvam07 Nov 4, 2026
c4b2855
Trigger CI build
divakar-selvam07 Nov 5, 2026
ddf3e49
Trigger CI build
divakar-selvam07 Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@
#### [nidmm] Unreleased
- Added
- Added the `nidmm_measure_ac_volts.py` example.
- Added the `nidmm_max_dc_reading_rate_at_7_5_digits.py` example.
- Added the `nidmm_cont_acq_chart_multiple_samples.py` example.
- Added the `nidmm_cont_acq_multiple_samples_ext_trig.py` example.
- Added the `nidmm_diode_test.py` example.
Expand Down
9 changes: 9 additions & 0 deletions docs/nidmm/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ nidmm_improve_dc_noise_rejection.py
:encoding: utf8
:caption: `(nidmm_improve_dc_noise_rejection.py) <https://github.com/ni/nimi-python/blob/master/src/nidmm/examples/nidmm_improve_dc_noise_rejection.py>`_

nidmm_max_dc_reading_rate_at_7_5_digits.py
------------------------------------------

.. literalinclude:: ../../src/nidmm/examples/nidmm_max_dc_reading_rate_at_7_5_digits.py
:language: python
:linenos:
:encoding: utf8
:caption: `(nidmm_max_dc_reading_rate_at_7_5_digits.py) <https://github.com/ni/nimi-python/blob/master/src/nidmm/examples/nidmm_max_dc_reading_rate_at_7_5_digits.py>`_

nidmm_measure_ac_volts.py
-------------------------

Expand Down
71 changes: 71 additions & 0 deletions src/nidmm/examples/nidmm_max_dc_reading_rate_at_7_5_digits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/python

import argparse
import nidmm
import sys
import time


SUPPORTED_MODELS = ('4071', '4081')


def example(device_name, options, powerline_frequency, measurement_range, aperture_time, adc_calibration, auto_zero, number_of_averages, total_samples):
with nidmm.Session(resource_name=device_name, reset_device=True, options=options) as session:
if not session.instrument_model.endswith(SUPPORTED_MODELS):
raise ValueError(f'{session.instrument_model} is not supported. This example requires an NI PXI-4071 or NI PXIe-4081.')

# Powerline frequency defines the timebase for aperture values in PLCs.
session.powerline_freq = powerline_frequency
session.configure_measurement_digits(measurement_function=nidmm.Function.DC_VOLTS, range=measurement_range, resolution_digits=7.5)
# A sample count of zero selects continuous acquisition.
session.configure_multi_point(trigger_count=1, sample_count=0)
session.aperture_time_units = nidmm.ApertureTimeUnits.POWER_LINE_CYCLES
session.aperture_time = aperture_time
session.number_of_averages = number_of_averages
session.auto_zero = nidmm.AutoZero[auto_zero]
# Disabling ADC calibration avoids the gain-reference measurement and increases reading rate.
session.adc_calibration = nidmm.ADCCalibration[adc_calibration]

samples_fetched = 0
start_time = time.perf_counter()
with session.initiate():
while samples_fetched < total_samples:
backlog, _ = session.read_status()
backlog = min(backlog, total_samples - samples_fetched)
new_samples = session.fetch_multi_point(array_size=backlog) if backlog > 0 else ()
samples_fetched += len(new_samples)
elapsed = time.perf_counter() - start_time
print(f'Fetched {samples_fetched} readings in {elapsed:.2f} s ({samples_fetched / elapsed:.0f} reads/sec)')


def _main(argsv):
parser = argparse.ArgumentParser(description='Achieves the higher DC voltage reading rate at 7.5 digits of resolution with a PXI-4071 or PXIe-4081 and prints the achieved reading rate.', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-n', '--device-name', default='PXI1Slot2', help='Contains the resource_name of the device to initialize.')
parser.add_argument('-p', '--powerline-frequency', default=60.0, type=float, choices=[50.0, 60.0], help='Specifies the powerline frequency.')
parser.add_argument('-r', '--range', default=10.0, type=float, help='Specifies the range for the function specified in the Measurement_Function parameter.')
parser.add_argument('-a', '--aperture-time', default=1.0, type=float, help='Specifies the measurement aperture time for the current configuration, in powerline cycles (PLCs).')
parser.add_argument('-c', '--adc-calibration', default='OFF', choices=nidmm.ADCCalibration.__members__.keys(), type=str.upper, help='Specifies the ADC calibration mode.')
parser.add_argument('-z', '--auto-zero', default='ON', choices=nidmm.AutoZero.__members__.keys(), type=str.upper, help='Specifies the AutoZero mode.')
parser.add_argument('-v', '--number-of-averages', default=4, type=int, help='Specifies the number of averages to perform in a measurement.')
parser.add_argument('--total-samples', default=100, type=int, help='Number of readings to fetch before stopping.')
parser.add_argument('-op', '--option-string', default='', type=str, help='Sets the initial value of certain attributes for the session.')
args = parser.parse_args(argsv)
example(args.device_name, args.option_string, args.powerline_frequency, args.range, args.aperture_time, args.adc_calibration, args.auto_zero, args.number_of_averages, args.total_samples)


def main():
_main(sys.argv[1:])


def test_example():
options = {'simulate': True, 'driver_setup': {'Model': '4081', 'BoardType': 'PXIe', }, }
example('PXI1Slot2', options, 60.0, 10.0, 1.0, 'OFF', 'ON', 4, 100)


def test_main():
cmd_line = ['--option-string', 'Simulate=1, DriverSetup=Model:4081; BoardType:PXIe', ]
_main(cmd_line)


if __name__ == '__main__':
main()
Loading