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 090b1cf06ee3952ca1e2b5abf340f489089e3bdf Mon Sep 17 00:00:00 2001 From: "Selvam, Divakar" Date: Mon, 26 Oct 2026 16:55:01 +0530 Subject: [PATCH 3/3] add: add Create from File I16 example --- CHANGELOG.md | 1 + docs/nifgen/examples.rst | 9 +++ .../examples/data/SineI16BigEndian_1000.bin | Bin 0 -> 2000 bytes .../examples/nifgen_create_from_file_i16.py | 53 ++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 src/nifgen/examples/data/SineI16BigEndian_1000.bin create mode 100644 src/nifgen/examples/nifgen_create_from_file_i16.py diff --git a/CHANGELOG.md b/CHANGELOG.md index cfa7540d47..abc765af54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1128,6 +1128,7 @@ #### [nifgen] Unreleased - Added - (Common) Added `nitlsconfig[grpc]>=1.0.0a2` to the optional gRPC dependencies. + - Added the `nifgen_create_from_file_i16.py` example. - Changed - Removed diff --git a/docs/nifgen/examples.rst b/docs/nifgen/examples.rst index 3731f4bea5..4373b22fa9 100644 --- a/docs/nifgen/examples.rst +++ b/docs/nifgen/examples.rst @@ -12,6 +12,15 @@ nifgen_arb_waveform.py :encoding: utf8 :caption: `(nifgen_arb_waveform.py) `_ +nifgen_create_from_file_i16.py +------------------------------ + +.. literalinclude:: ../../src/nifgen/examples/nifgen_create_from_file_i16.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nifgen_create_from_file_i16.py) `_ + nifgen_script.py ---------------- diff --git a/src/nifgen/examples/data/SineI16BigEndian_1000.bin b/src/nifgen/examples/data/SineI16BigEndian_1000.bin new file mode 100644 index 0000000000000000000000000000000000000000..a3e39d0f0a9564a1202db4925e84b272e5f9332a GIT binary patch literal 2000 zcmWNOcUY5G6vmMyQ&}QZhC&%(7e#1{43Scx3@Hi%0V9!3STaNMePIt-VPi0bKtvoM z2o4aLDMKhS0!V|b78<68p#-q^kNZ6Lx%Zs&zVGkw@bC;Dqwogu8S@M9j|o%?;*O() zgoP%Bt3|>^&BVmSrp0ScM4U905S5seq)CNJBV`0-KAfV+`kgjBeIUn>&-=msjOv*+ zg=R&9l9jT!^2AxnIUf}*l`YklAMtAD>H_Km8abNR5Hg5Ktuk#79Yvj4U8_DzU2yBaiN3kzp6DU%LGv{9>_j`DXS{s9K6}UC;=7fFk;IhT zR=7>|QSqt9s$r||sNSjcRrD?Mlkv;;7xX9ia{>YaSbc`=BvHtRN4zf!EfSX=)>vD&h-yjo&U&$4t`H>vA1x2W5UK6FG)d z_!(>R#F%4@ya*fh8i`zRI8Qd5FqHer-GHJ$tFNTztxMIJ)lt;;&?-YrB4jkLY2>I6 zs0*l>|A<#@QQ1<_I_GniqCBB2u4JW1P-s50c1HCFclkUy#_5C8hO&OAC^8>p1f`Ku zp^`L-NeR)DrY9oAYs99-#6-i{csqci) z$7ToWU1s}KyT;p?w!Sv`)}S|U-$=a1zIy%Y#7k^TYm0Pq(2JfIN=>ni(a5V~@JdI?YG9wO?y758ppDrqk#WHN@)mYBX(_W>(c$rB+#9 zdGe1`>LE4i!RCX2ilqt+WtQT3f9AetIjh{eY_ZI*bgeY9WWOY-M7+49Shc93$h2^% z5M8iQ02fG;Ysr`M$Mb{p1@fqQ$XsS_WUf?BV~%t7c6LcN>fZdl^m_(bQ&~w_dYK9|St(8_vdOGudU9woGFdQb zJc*VRk#sdlHj$n9F0m*vB+)8SnZzYclA1|{q$rXr2}x2S@xg3(6mEm*Fd2qn9P9-< z!dGA;SPMP}%fXVcD102|hk4;+;P8XHD0q_te_EjC3aIr0Juv8{gBhbRo5TlZBEjq^ zpwSGpxQWU@Hw5UvOJpa>0zVPJ*LboZ@E8ibvQlJ$@2r%*R6&p)KIKiTv8$q_OM?XS-Mu{SGHL0UCz1>c17`|%vNA3mL3E=*rY~L5C2H5 zJXu*@rB>BQGouYxqpR0zh;#`$?V<6*_qCYXua9!;H0wGadpzEKlK)ii>EN@#dg1!o z2AhV}=h=-0jpI$RFO**NGzYavx3s>*zB=*h^=s@Ki8pUsgWBZV`rgL0YqU?j%j`gP zY<5<4-RKtW?&yi`)$LtkQ2uo36Ypd6!vmKFb_W~Z5 z|H|-xWo+!K{_6f3V?BQZy@}Y|+3Nb7^TmUs!P(yK+{xYb+(Yc`eeL;1-uLF}a=8cn Lhs8(O?}q;avUTJ; literal 0 HcmV?d00001 diff --git a/src/nifgen/examples/nifgen_create_from_file_i16.py b/src/nifgen/examples/nifgen_create_from_file_i16.py new file mode 100644 index 0000000000..5bdfc86074 --- /dev/null +++ b/src/nifgen/examples/nifgen_create_from_file_i16.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +import argparse +import nifgen +from pathlib import Path +import sys +import time + + +def example(resource_name, options, sample_rate, file_path, byte_order, gen_time): + waveform_path = (Path(__file__).resolve().parent / file_path).resolve(strict=True) + + with nifgen.Session(resource_name=resource_name, channel_name='0', options=options) as session: + session.output_mode = nifgen.OutputMode.ARB + session.arb_sample_rate = sample_rate + waveform = session.create_waveform_from_file_i16(file_name=str(waveform_path), byte_order=nifgen.ByteOrder[byte_order]) + session.arb_waveform_handle = waveform + with session.initiate(): + print('Generating waveform. Press Ctrl+C to stop.') + start_time = time.monotonic() + while time.monotonic() - start_time < gen_time: + session.is_done() + time.sleep(0.1) + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Generates an arbitrary waveform from a file storing I16 data.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='PXI1Slot2', help='Specifies the resource name of the device to initialize.') + parser.add_argument('-r', '--sample-rate', default=40e6, type=float, help='Specifies the rate at which the signal generator outputs the points in arbitrary waveforms.') + parser.add_argument('-f', '--file-path', default='data/SineI16BigEndian_1000.bin', help='The full path and name of the file where the waveform data resides. Relative paths are resolved beside this example.') + parser.add_argument('-b', '--byte-order', default='BIG', choices=nifgen.ByteOrder.__members__.keys(), type=str.upper, help='Specifies the byte order of the data in the file.') + parser.add_argument('-t', '--time', default=5.0, type=float, help='Generation time (s)') + parser.add_argument('-op', '--option-string', default='', type=str, help='Specifies the initial value of certain properties for the session.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.sample_rate, args.file_path, args.byte_order, args.time) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = {'simulate': True, 'driver_setup': {'Model': '5433 (2CH)', 'BoardType': 'PXIe'}} + example('PXI1Slot2', options, 40e6, 'data/SineI16BigEndian_1000.bin', 'BIG', 5.0) + + +def test_main(): + cmd_line = ['--option-string', 'Simulate=1, DriverSetup=Model:5433 (2CH);BoardType:PXIe'] + _main(cmd_line) + + +if __name__ == '__main__': + main()