From 4eb862408081a48bf127a0eb251266592c1cf9c2 Mon Sep 17 00:00:00 2001 From: NI-velmurugan Date: Wed, 7 Oct 2026 19:45:14 +0530 Subject: [PATCH 1/3] 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 8305ba26e923b280a766b480f52f77b1170c6fcd Mon Sep 17 00:00:00 2001 From: Divakar Date: Thu, 8 Oct 2026 16:17:45 +0530 Subject: [PATCH 2/3] 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 5eca951762be68badc222af0526faab92af32811 Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Thu, 29 Oct 2026 22:57:35 +0530 Subject: [PATCH 3/3] Add NI-Digital burst with conditional trigger example --- CHANGELOG.md | 1 + docs/nidigital/examples.rst | 9 ++ .../Pattern.digipat | Bin 0 -> 7186 bytes .../PinLevels.digilevels | 15 +++ .../PinMap.pinmap | 51 ++++++++ .../Specifications.specs | 9 ++ .../Timing.digitiming | 23 ++++ .../burst_with_conditional_trigger.digiproj | 38 ++++++ ...idigital_burst_with_conditional_trigger.py | 115 ++++++++++++++++++ 9 files changed, 261 insertions(+) create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/Pattern.digipat create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/PinLevels.digilevels create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/PinMap.pinmap create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/Specifications.specs create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/Timing.digitiming create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/burst_with_conditional_trigger.digiproj create mode 100644 src/nidigital/examples/burst_with_conditional_trigger/nidigital_burst_with_conditional_trigger.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bc3af6804..cf06cfa156 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_burst_with_conditional_trigger.py` example. - Changed - Removed diff --git a/docs/nidigital/examples.rst b/docs/nidigital/examples.rst index b8c8cc689a..5518f79e0e 100644 --- a/docs/nidigital/examples.rst +++ b/docs/nidigital/examples.rst @@ -3,6 +3,15 @@ Examples `You can download all nidigital examples for latest version here `_ +nidigital_burst_with_conditional_trigger.py +------------------------------------------- + +.. literalinclude:: ../../src/nidigital/examples/burst_with_conditional_trigger/nidigital_burst_with_conditional_trigger.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nidigital_burst_with_conditional_trigger.py) `_ + nidigital_burst_with_start_trigger.py ------------------------------------- diff --git a/src/nidigital/examples/burst_with_conditional_trigger/Pattern.digipat b/src/nidigital/examples/burst_with_conditional_trigger/Pattern.digipat new file mode 100644 index 0000000000000000000000000000000000000000..9bcce0423550d06e7f9d53acffa4e33f499352c7 GIT binary patch literal 7186 zcmcgwTW=dh6y8uMy^vC9QD`aD5ztL2!cCe&x#!|Eb(_#AaT6p2?Z%!Y+uFNkJnHe=V*5>uTp`#q=Fq@Q0N5fqaDq;+TV%x9aby2jrK(vkn)$kg}}+FStsyZZ{dnJ z?JTJs#7aa3!MdMX(!QvOCa{sG=!{871mzGtMy|VrFhNX1Vm#nV+O&)XFM&4+F$pk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idigital/examples/burst_with_conditional_trigger/PinLevels.digilevels new file mode 100644 index 0000000000..35dc1d1866 --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/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/burst_with_conditional_trigger/PinMap.pinmap b/src/nidigital/examples/burst_with_conditional_trigger/PinMap.pinmap new file mode 100644 index 0000000000..d6fa6148d0 --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/PinMap.pinmap @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nidigital/examples/burst_with_conditional_trigger/Specifications.specs b/src/nidigital/examples/burst_with_conditional_trigger/Specifications.specs new file mode 100644 index 0000000000..51ba58bb5a --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/Specifications.specs @@ -0,0 +1,9 @@ + + +
+ + 1 µs + +
+ +
\ No newline at end of file diff --git a/src/nidigital/examples/burst_with_conditional_trigger/Timing.digitiming b/src/nidigital/examples/burst_with_conditional_trigger/Timing.digitiming new file mode 100644 index 0000000000..d020f8c7bb --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/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/burst_with_conditional_trigger/burst_with_conditional_trigger.digiproj b/src/nidigital/examples/burst_with_conditional_trigger/burst_with_conditional_trigger.digiproj new file mode 100644 index 0000000000..4d3d3e03af --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/burst_with_conditional_trigger.digiproj @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nidigital/examples/burst_with_conditional_trigger/nidigital_burst_with_conditional_trigger.py b/src/nidigital/examples/burst_with_conditional_trigger/nidigital_burst_with_conditional_trigger.py new file mode 100644 index 0000000000..df6582eb7e --- /dev/null +++ b/src/nidigital/examples/burst_with_conditional_trigger/nidigital_burst_with_conditional_trigger.py @@ -0,0 +1,115 @@ +#!/usr/bin/python + +import argparse +import nidigital +import os +import sys + + +def example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger): + + with nidigital.Session(resource_name=resource_name, reset_device=True, options=options) as session: + + directory = os.path.dirname(os.path.abspath(__file__)) + + # Load the pin map (.pinmap) created using the Digital Pattern Editor + pin_map_filename = os.path.join(directory, '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(directory, 'Specifications.specs') + levels_filename = os.path.join(directory, 'PinLevels.digilevels') + timing_filename = os.path.join(directory, '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(directory, 'Pattern.digipat') + session.load_pattern(pattern_filename) + + # Configure the conditional jump trigger instance used by the pattern + trigger_identifier = 'conditionalJumpTrigger0' + conditional_trigger = session.conditional_jump_triggers[trigger_identifier] + conditional_trigger.conditional_jump_trigger_type = trigger_type + if trigger_type == nidigital.TriggerType.DIGITAL_EDGE: + # Specify a source and edge for the external conditional jump trigger + conditional_trigger.digital_edge_conditional_jump_trigger_source = trigger_source + conditional_trigger.digital_edge_conditional_jump_trigger_edge = trigger_edge + + try: + print('Start bursting pattern') + if trigger_type == nidigital.TriggerType.SOFTWARE: + # Start the burst without blocking so the software conditional trigger can be sent + session.burst_pattern(start_label='new_pattern', wait_until_done=False) + if not send_software_trigger: + print('Pattern burst stopped without sending a software trigger') + return + + # Send the software conditional trigger and wait until the pattern is done bursting + session.send_software_edge_trigger(nidigital.SoftwareTrigger.CONDITIONAL_JUMP, trigger_identifier) + session.wait_until_done() + else: + # Burst the pattern and block until completion, including any wait for an external conditional trigger + session.burst_pattern(start_label='new_pattern') + finally: + try: + # Abort any pending burst before disconnecting the channels + session.abort() + finally: + # 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 burst a pattern on the digital pattern instrument using a conditional trigger.', 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.') + parser.add_argument('-s', '--simulate', default='True', choices=['True', 'False'], help='Whether to run on simulated hardware or real hardware') + parser.add_argument('-tt', '--trigger-type', default='SOFTWARE', type=str.upper, choices=nidigital.TriggerType.__members__, help='Disables the conditional jump trigger or configures it for either hardware triggering or software triggering.') + parser.add_argument('-ts', '--trigger-source', default='/PXI1Slot2/PXI_Trig0', help='Configures the digital trigger source terminal for a conditional jump trigger instance.') + parser.add_argument('-te', '--trigger-edge', default='RISING', type=str.upper, choices=nidigital.DigitalEdge.__members__, help='Configures the active edge of the incoming trigger signal for the conditional jump trigger instance.') + parser.add_argument('--send-software-trigger', default='True', choices=['True', 'False'], help='Whether to send the software conditional trigger or stop the burst without sending it; applies only to SOFTWARE mode.') + args = parser.parse_args(argsv) + + example(args.resource_name, + 'Simulate=1, DriverSetup=Model:6570' if args.simulate == 'True' else '', + nidigital.TriggerType[args.trigger_type], args.trigger_source, + nidigital.DigitalEdge[args.trigger_edge], args.send_software_trigger == 'True') + + +def main(): + _main(sys.argv[1:]) + + +def test_main(): + _main([]) + _main(['--trigger-type', 'NONE']) + _main(['--trigger-type', 'DIGITAL_EDGE']) + _main(['--trigger-type', 'DIGITAL_EDGE', '--trigger-edge', 'FALLING']) + _main(['--send-software-trigger', 'False']) + + +def test_example(): + resource_name = 'PXI1Slot2,PXI1Slot3' + options = {'simulate': True, 'driver_setup': {'Model': '6570'}} + trigger_source = '/PXI1Slot2/PXI_Trig0' + trigger_edge = nidigital.DigitalEdge.RISING + + trigger_type = nidigital.TriggerType.SOFTWARE + example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger=True) + example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger=False) + + trigger_type = nidigital.TriggerType.NONE + example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger=True) + + trigger_type = nidigital.TriggerType.DIGITAL_EDGE + example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger=True) + + trigger_edge = nidigital.DigitalEdge.FALLING + example(resource_name, options, trigger_type, trigger_source, trigger_edge, send_software_trigger=True) + + +if __name__ == '__main__': + main()