From 257d8be46b9b34e4393309a34fc7ab7b20f586bb Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 4 Nov 2026 07:10:27 +0000 Subject: [PATCH 1/4] Adding Load Sheets and Burst example in NI-Digital --- CHANGELOG.md | 1 + docs/nidigital/examples.rst | 9 +++ .../load_sheets_and_burst/Pattern.digipat | Bin 0 -> 3949 bytes .../PinLevels.digilevels | 15 ++++ .../load_sheets_and_burst/PinMap.pinmap | 29 ++++++++ .../Specifications.specs | 9 +++ .../load_sheets_and_burst/Timing.digitiming | 23 ++++++ .../load_sheets_and_burst.digiproj | 38 ++++++++++ .../nidigital_load_sheets_and_burst.py | 68 ++++++++++++++++++ 9 files changed, 192 insertions(+) create mode 100644 src/nidigital/examples/load_sheets_and_burst/Pattern.digipat create mode 100644 src/nidigital/examples/load_sheets_and_burst/PinLevels.digilevels create mode 100644 src/nidigital/examples/load_sheets_and_burst/PinMap.pinmap create mode 100644 src/nidigital/examples/load_sheets_and_burst/Specifications.specs create mode 100644 src/nidigital/examples/load_sheets_and_burst/Timing.digitiming create mode 100644 src/nidigital/examples/load_sheets_and_burst/load_sheets_and_burst.digiproj create mode 100644 src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 092ff8d859..b94d2d4a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -558,6 +558,7 @@ #### [nidigital] Unreleased - Added - (Common) Added `nitlsconfig[grpc]>=1.0.0a2` to the optional gRPC dependencies. + - Added the `nidigital_load_sheets_and_burst.py` example. - Changed - Removed diff --git a/docs/nidigital/examples.rst b/docs/nidigital/examples.rst index b8c8cc689a..cde76451ef 100644 --- a/docs/nidigital/examples.rst +++ b/docs/nidigital/examples.rst @@ -21,6 +21,15 @@ nidigital_configure_time_set_and_voltage_levels.py :encoding: utf8 :caption: `(nidigital_configure_time_set_and_voltage_levels.py) `_ +nidigital_load_sheets_and_burst.py +---------------------------------- + +.. literalinclude:: ../../src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nidigital_load_sheets_and_burst.py) `_ + nidigital_ppmu_source_and_measure.py ------------------------------------ diff --git a/src/nidigital/examples/load_sheets_and_burst/Pattern.digipat b/src/nidigital/examples/load_sheets_and_burst/Pattern.digipat new file mode 100644 index 0000000000000000000000000000000000000000..8d6f3c6c1e5440b59f0c507195cdf6222f752383 GIT binary patch literal 3949 zcmcgvT~8B16kSv_e&T0hqS5-aF(DQnOf-HXC|1D`sl1YHJHTRhw@#$WBP3y_gtK%cnh1A=3>{)hob}QL<6^%*&2R|HNDm6i>`n;vO0eFt7FO3{Mqgm z3VfcY%0oQCb4>(PE@u@ekBHA$QnBv{xdd4&!!;t3^>pUA&Jx*6 z-0GSY8~-*|1wxzHj8D5z^aVuFUY1r5KbxpyY>057b3$CebwgewSPk8SG(5W9(!b`=eB+#vhBrVUNzHtk_w-|OJCKlmuB)!a*a@LNnLJ6%%o5PngbH;PmHf)cJ%hak?ExG;CzqF+DA?w7a{Tjg3Qi-8+@8HXU$;cBTgp6Rlj80d$BWZ zH?XEivC|9N5}M2|XM@xsz;LTi_Dp`mh?9k3W~2YrnBG!XuKOpL<>wWTJrPVAaP?P} z7c-Oa7i5VMp+d8JsA4T^N8PokWx5sTVv23L8f!!f<&Y2=E^Fp~d!+Bv4+4}CfA!<>bFo}?wwuR-s1?sG-x zohqIbfqApA842_3tk1opoJ4Tnm*(eCBbC1lgZ40sadG)RJKJ&TsDc-YWfb@uET$jI MvH5qK3l5L|0-q6HMF0Q* literal 0 HcmV?d00001 diff --git a/src/nidigital/examples/load_sheets_and_burst/PinLevels.digilevels b/src/nidigital/examples/load_sheets_and_burst/PinLevels.digilevels new file mode 100644 index 0000000000..1908b117fa --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/PinLevels.digilevels @@ -0,0 +1,15 @@ + + + + + + 0 + 3.3 + 0.8 + 2 + 0 + HighZ + + + + \ No newline at end of file diff --git a/src/nidigital/examples/load_sheets_and_burst/PinMap.pinmap b/src/nidigital/examples/load_sheets_and_burst/PinMap.pinmap new file mode 100644 index 0000000000..1ed3183662 --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/PinMap.pinmap @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nidigital/examples/load_sheets_and_burst/Specifications.specs b/src/nidigital/examples/load_sheets_and_burst/Specifications.specs new file mode 100644 index 0000000000..65c615cfd6 --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/Specifications.specs @@ -0,0 +1,9 @@ + + +
+ + 1 µs + +
+ +
\ No newline at end of file diff --git a/src/nidigital/examples/load_sheets_and_burst/Timing.digitiming b/src/nidigital/examples/load_sheets_and_burst/Timing.digitiming new file mode 100644 index 0000000000..fe5064ec43 --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/Timing.digitiming @@ -0,0 +1,23 @@ + + + + + + timing.period + + + + 0 µs + timing.period / 2 + timing.period + + + (3 * timing.period) / 4 + + Pattern + + + + + + \ No newline at end of file diff --git a/src/nidigital/examples/load_sheets_and_burst/load_sheets_and_burst.digiproj b/src/nidigital/examples/load_sheets_and_burst/load_sheets_and_burst.digiproj new file mode 100644 index 0000000000..be07fcaadd --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/load_sheets_and_burst.digiproj @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py new file mode 100644 index 0000000000..dfc23e1e51 --- /dev/null +++ b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py @@ -0,0 +1,68 @@ +#!/usr/bin/python + +import argparse +import nidigital +import os +import sys + + +def example(resource_name, options, start_label): + + with nidigital.Session(resource_name=resource_name, options=options) as session: + + dir = os.path.join(os.path.dirname(__file__)) + + # Load the pin map (.pinmap) created using the Digital Pattern Editor + pin_map_filename = os.path.join(dir, 'PinMap.pinmap') + session.load_pin_map(pin_map_filename) + + # Load the specifications (.specs), levels (.digilevels), and timing (.digitiming) sheets created using the Digital Pattern Editor + spec_filename = os.path.join(dir, 'Specifications.specs') + levels_filename = os.path.join(dir, 'PinLevels.digilevels') + timing_filename = os.path.join(dir, 'Timing.digitiming') + session.load_specifications_levels_and_timing(spec_filename, levels_filename, timing_filename) + + # Apply the settings from the levels and timing sheets we just loaded to the session + session.apply_levels_and_timing(levels_filename, timing_filename) + + # Load the pattern file (.digipat) created using the Digital Pattern Editor + pattern_filename = os.path.join(dir, 'Pattern.digipat') + session.load_pattern(pattern_filename) + + # Burst the pattern from the start label, which can be a label in the .digipat file or the name of the pattern + print('Start bursting pattern') + session.burst_pattern(start_label=start_label) + + # Disconnect all channels using programmable onboard switching + session.selected_function = nidigital.SelectedFunction.DISCONNECT + print('Done bursting pattern') + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Demonstrates how to load the pin map, specifications, levels, timing, and pattern files on a digital pattern instrument and burst the pattern.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='PXI1Slot2,PXI1Slot3', help='The specified resource name shown in Measurement & Automation Explorer (MAX) for a digital pattern instrument, for example, PXI1Slot3, where PXI1Slot3 is an instrument resource name. This parameter accepts a comma-delimited list of strings in the form PXI1Slot2,PXI1Slot3. List the instruments in the same order they appear in the pin map.') + parser.add_argument('-s', '--simulate', action='store_true', help='Run on simulated hardware instead of real hardware') + parser.add_argument('-l', '--start-label', default='new_pattern', help='Pattern name or exported pattern label from which to start bursting the pattern.') + args = parser.parse_args(argsv) + + example(args.resource_name, + 'Simulate=1, DriverSetup=Model:6570' if args.simulate else '', + args.start_label) + + +def main(): + _main(sys.argv[1:]) + + +def test_main(): + _main(['--simulate']) + + +def test_example(): + resource_name = 'PXI1Slot2,PXI1Slot3' + options = {'simulate': True, 'driver_setup': {'Model': '6570'}, } + example(resource_name, options, 'new_pattern') + + +if __name__ == '__main__': + main() From b7f28531a3645987f8c762260b5af733568d7db9 Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 4 Nov 2026 11:48:23 +0000 Subject: [PATCH 2/4] Addressing PR comments --- .../nidigital_load_sheets_and_burst.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py index dfc23e1e51..db520f07e5 100644 --- a/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py +++ b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py @@ -41,12 +41,12 @@ def example(resource_name, options, start_label): def _main(argsv): parser = argparse.ArgumentParser(description='Demonstrates how to load the pin map, specifications, levels, timing, and pattern files on a digital pattern instrument and burst the pattern.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-n', '--resource-name', default='PXI1Slot2,PXI1Slot3', help='The specified resource name shown in Measurement & Automation Explorer (MAX) for a digital pattern instrument, for example, PXI1Slot3, where PXI1Slot3 is an instrument resource name. This parameter accepts a comma-delimited list of strings in the form PXI1Slot2,PXI1Slot3. List the instruments in the same order they appear in the pin map.') - parser.add_argument('-s', '--simulate', action='store_true', help='Run on simulated hardware instead of real hardware') + parser.add_argument('-s', '--simulate', default='True', choices=['True', 'False'], help='Whether to run on simulated hardware or real hardware') parser.add_argument('-l', '--start-label', default='new_pattern', help='Pattern name or exported pattern label from which to start bursting the pattern.') args = parser.parse_args(argsv) example(args.resource_name, - 'Simulate=1, DriverSetup=Model:6570' if args.simulate else '', + 'Simulate=1, DriverSetup=Model:6570' if args.simulate == 'True' else '', args.start_label) @@ -55,13 +55,14 @@ def main(): def test_main(): - _main(['--simulate']) + _main([]) def test_example(): resource_name = 'PXI1Slot2,PXI1Slot3' options = {'simulate': True, 'driver_setup': {'Model': '6570'}, } - example(resource_name, options, 'new_pattern') + start_label = 'new_pattern' + example(resource_name, options, start_label) if __name__ == '__main__': From ef0c3ba4c54447b08b3808679fea96f10b99ee18 Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 4 Nov 2026 13:37:17 +0000 Subject: [PATCH 3/4] Removing self explanatory comments --- .../nidigital_load_sheets_and_burst.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py index db520f07e5..6fc54ce9f4 100644 --- a/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py +++ b/src/nidigital/examples/load_sheets_and_burst/nidigital_load_sheets_and_burst.py @@ -12,35 +12,29 @@ def example(resource_name, options, start_label): dir = os.path.join(os.path.dirname(__file__)) - # Load the pin map (.pinmap) created using the Digital Pattern Editor pin_map_filename = os.path.join(dir, 'PinMap.pinmap') session.load_pin_map(pin_map_filename) - # Load the specifications (.specs), levels (.digilevels), and timing (.digitiming) sheets created using the Digital Pattern Editor spec_filename = os.path.join(dir, 'Specifications.specs') levels_filename = os.path.join(dir, 'PinLevels.digilevels') timing_filename = os.path.join(dir, 'Timing.digitiming') session.load_specifications_levels_and_timing(spec_filename, levels_filename, timing_filename) - # Apply the settings from the levels and timing sheets we just loaded to the session session.apply_levels_and_timing(levels_filename, timing_filename) - # Load the pattern file (.digipat) created using the Digital Pattern Editor pattern_filename = os.path.join(dir, 'Pattern.digipat') session.load_pattern(pattern_filename) - # Burst the pattern from the start label, which can be a label in the .digipat file or the name of the pattern print('Start bursting pattern') session.burst_pattern(start_label=start_label) - # Disconnect all channels using programmable onboard switching session.selected_function = nidigital.SelectedFunction.DISCONNECT print('Done bursting pattern') def _main(argsv): parser = argparse.ArgumentParser(description='Demonstrates how to load the pin map, specifications, levels, timing, and pattern files on a digital pattern instrument and burst the pattern.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('-n', '--resource-name', default='PXI1Slot2,PXI1Slot3', help='The specified resource name shown in Measurement & Automation Explorer (MAX) for a digital pattern instrument, for example, PXI1Slot3, where PXI1Slot3 is an instrument resource name. This parameter accepts a comma-delimited list of strings in the form PXI1Slot2,PXI1Slot3. List the instruments in the same order they appear in the pin map.') + parser.add_argument('-n', '--resource-name', default='PXI1Slot2,PXI1Slot3', help='The specified resource name of a digital pattern instrument, for example, PXI1Slot3, where PXI1Slot3 is an instrument resource name.') parser.add_argument('-s', '--simulate', default='True', choices=['True', 'False'], help='Whether to run on simulated hardware or real hardware') parser.add_argument('-l', '--start-label', default='new_pattern', help='Pattern name or exported pattern label from which to start bursting the pattern.') args = parser.parse_args(argsv) From dfb9f450bb90bba4df483d4ec1e0a50b27a007c7 Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 11 Nov 2026 11:59:34 +0000 Subject: [PATCH 4/4] Trigger CI build