<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic DAQmx: read value(s) with delay in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289876#M961663</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a part of my initial setup:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;analog output generates a value at each loop iteration&lt;/LI&gt;
&lt;LI&gt;analog input must wait for some time (50ms in this&amp;nbsp;case)&lt;/LI&gt;
&lt;LI&gt;then AI reads a number of samples&lt;/LI&gt;
&lt;LI&gt;then it calculates average, that is used for further processing (in this simplified version connected to 2nd output to be controlled at oscilloscope).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This setup doesn't work, generate error 200284 (some or all samples requested have not been required).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similar example I've found here:&lt;/P&gt;
&lt;P data-unlink="true"&gt;http://www.ni.com/example/25905/en/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in adavnce.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Read_value_with_delay (0).png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/e5defbb5c73f26d08ee6cbf5dc02e0b338ad8466/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383237373369354437423641424333454143414145392f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Read_value_with_delay (0).png" alt="Read_value_with_delay (0).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 19:35:09 GMT</pubDate>
    <dc:creator>Pavel_47</dc:creator>
    <dc:date>2025-06-04T19:35:09Z</dc:date>
    <item>
      <title>DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289876#M961663</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a part of my initial setup:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;analog output generates a value at each loop iteration&lt;/LI&gt;
&lt;LI&gt;analog input must wait for some time (50ms in this&amp;nbsp;case)&lt;/LI&gt;
&lt;LI&gt;then AI reads a number of samples&lt;/LI&gt;
&lt;LI&gt;then it calculates average, that is used for further processing (in this simplified version connected to 2nd output to be controlled at oscilloscope).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This setup doesn't work, generate error 200284 (some or all samples requested have not been required).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similar example I've found here:&lt;/P&gt;
&lt;P data-unlink="true"&gt;http://www.ni.com/example/25905/en/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in adavnce.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Read_value_with_delay (0).png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/e5defbb5c73f26d08ee6cbf5dc02e0b338ad8466/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383237373369354437423641424333454143414145392f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Read_value_with_delay (0).png" alt="Read_value_with_delay (0).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:35:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289876#M961663</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2025-06-04T19:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289882#M961666</link>
      <description>&lt;P&gt;A couple of questions.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The example does a&amp;nbsp;&lt;U&gt;single sample&lt;/U&gt;. &amp;nbsp;Your AI task is also set up as a&amp;nbsp;&lt;U&gt;single sample&lt;/U&gt;, as you start and stop the task&amp;nbsp;&lt;U&gt;within the loop&lt;/U&gt;.&lt;/LI&gt;&lt;LI&gt;Look at how the example starts the tasks. &amp;nbsp;Which does it start first? &amp;nbsp;Can you understand why that is important? &amp;nbsp;Think about it, then fix your code.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Bob Schor&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 13:33:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289882#M961666</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2016-05-02T13:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289903#M961679</link>
      <description>&lt;P&gt;Indeed, "read" starts first.&lt;/P&gt;&lt;P&gt;So, the solution would be put start/stop staff for generation branch also inside loop ?&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 14:06:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289903#M961679</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-02T14:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289912#M961686</link>
      <description>&lt;P&gt;No, to start both&amp;nbsp;&lt;U&gt;outside&lt;/U&gt; the loop. &amp;nbsp;Think about the sequence you want to have happen. &amp;nbsp;Both the AI and AO systems are running, waiting for something to do. &amp;nbsp;The AO gets a trigger, does its thing, generates (after a delay) the AI trigger, the AI is Ready to Roll so it also does its thing, the loop "loops", and you Do It Again. &amp;nbsp;The point being,&amp;nbsp;&lt;U&gt;everybody is running and waiting for their signal&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob Schor&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 14:18:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289912#M961686</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2016-05-02T14:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289956#M961699</link>
      <description>&lt;P&gt;Here is what I tried.&lt;/P&gt;&lt;P&gt;Once running it&amp;nbsp;generates the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Error -200557 occurred at Property Node DAQmx Trigger (arg 1) in read_input_with_delay (1).vi&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Possible reason(s):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Specified property cannot be set while the task is running.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set the property prior to starting the task, or stop the task prior to setting the property.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Property: Start.Delay&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Task Name: _unnamedTask&amp;lt;36&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that "Start" block&amp;nbsp;should be used after "Start Trigger". Isn't it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/856514d0cf0968751ac729081f6e4f9c41640845/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383237373769454143334537324642383038334238352f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="Read_value_with_delay (1).png" title="Read_value_with_delay (1).png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 15:08:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3289956#M961699</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-02T15:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290136#M961759</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/335318"&gt;@Pavel_47&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;It seems that "Start" block&amp;nbsp;should be used after "Start Trigger". Isn't it ?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No. You have the trigger being set up after you call the DAQmx Start Task.&amp;nbsp; All of your trigger setup should be done before that and before the loop.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 20:11:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290136#M961759</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2016-05-02T20:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290373#M961819</link>
      <description>&lt;P&gt;Thank you for suggestion.&lt;/P&gt;
&lt;P&gt;Here is what I've tried (snippet below).&lt;/P&gt;
&lt;P&gt;The same error: &lt;U&gt;some of all samples requested have not been acquired&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;I've looked through a number of examples concerning synhronization.&lt;/P&gt;
&lt;P&gt;None corresponds to my setup.&lt;/P&gt;
&lt;P&gt;All of them uses waveform defined &lt;U&gt;outside&lt;/U&gt; loop, whereas in my case the output is generated &lt;U&gt;inside&lt;/U&gt; loop.&lt;/P&gt;
&lt;P&gt;For example this one:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.ni.com/t5/NI-DAQmx-Examples/Multi-function-Synchronization-for-AI-and-AO/td-p/3490608" target="_blank" rel="noopener"&gt;https://forums.ni.com/t5/NI-DAQmx-Examples/Multi-function-Synchronization-for-AI-and-AO/td-p/3490608&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Read_value_with_delay (2).png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/fce0b2a9af80c8a224e425e5372ad5b486c80a9d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238323269363630353041433943413234303832452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Read_value_with_delay (2).png" alt="Read_value_with_delay (2).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:35:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290373#M961819</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2025-06-04T19:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290433#M961849</link>
      <description>&lt;P&gt;The issue&amp;nbsp;seems to be enchanted.&lt;/P&gt;&lt;P&gt;Having no solution with HW triggering, I've tried to create something similar using only LabVIEW programming features.&lt;/P&gt;&lt;P&gt;And even this doesn't work.&lt;/P&gt;&lt;P&gt;Here is the gernerated error (apparently it's impossible to copy error message as text !)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/3780cf7565f2b4ff71229657d3bca99c7e638d11/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238333269353931364645393739424445464446322f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="aaa.png" title="aaa.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/44f57bcd8fdd47c1323a70665609923097cbfbb8/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238333169433444383833394632313936333338392f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="Read_value_with_delay (3).png" title="Read_value_with_delay (3).png" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 12:22:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290433#M961849</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-03T12:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290521#M961877</link>
      <description>&lt;P&gt;Wow. &amp;nbsp;I got it to work, and in the process, learned something I didn't know about Finite Sampling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a USB-6009 that has 2 D/A output channels and A/D input channels, so I thought "Why not run this program on my own DAQ device?". &amp;nbsp;Of course, it didn't work, but for different reasons, such as my not having set the Max/Min properties of the Channels (your device probably allows D/A ranges of ±10V, but the USB-6009 is 0 to +5. &amp;nbsp;Not only do you need to set the Output Scales (easy to do with MAX Tasks), but you need to be sure that when you send the Averaged A/D Voltage out, you don't send a negative value (since I had no signal, I just send "Average + 1").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simplified my DAQmx coding by using MAX Tasks (see "Learn 10 Functions in NI-DAQmx ..." -- a Web Search will surely find this very nice NI White Paper). &amp;nbsp;But it still didn't work -- it failed on the&amp;nbsp;&lt;U&gt;second&lt;/U&gt; loop. &amp;nbsp;Now, I've never done Finite A/D sampling under program control before (I usually use Continuous Samples), so I wondered "Maybe I need the Start and Stop Task function&amp;nbsp;&lt;U&gt;inside&lt;/U&gt; the loop". &amp;nbsp;And then it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my slightly-revised code (I did some wiring cleanup). &amp;nbsp;Note that V_Output, V_Control, and V_Sample are the names of the DAQmx Tasks I created (where the "DAQmx Details" are hidden). &amp;nbsp;I did my best to get rid of frames, keeping only the one needed to "separate" the AO from the AI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/746acde9fbecaa1d2ede2f18c3041c766ec783f8/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238343369323331344245453534423145373743462f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="Revised AO-AI Routine.png" title="Revised AO-AI Routine.png" /&gt;&lt;/P&gt;&lt;P&gt;Bob Schor&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 14:06:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290521#M961877</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2016-05-03T14:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290639#M961916</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Bob_Schor a écrit&amp;nbsp;:&lt;BR /&gt;&lt;P&gt;Wow. &amp;nbsp;I got it to work, and in the process, learned something I didn't know about Finite Sampling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a USB-6009 that has 2 D/A output channels and A/D input channels, so I thought "Why not run this program on my own DAQ device?". &amp;nbsp;Of course, it didn't work, but for different reasons, such as my not having set the Max/Min properties of the Channels (your device probably allows D/A ranges of ±10V, but the USB-6009 is 0 to +5. &amp;nbsp;Not only do you need to set the Output Scales (easy to do with MAX Tasks), but you need to be sure that when you send the Averaged A/D Voltage out, you don't send a negative value (since I had no signal, I just send "Average + 1").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simplified my DAQmx coding by using MAX Tasks (see "Learn 10 Functions in NI-DAQmx ..." -- a Web Search will surely find this very nice NI White Paper). &amp;nbsp;But it still didn't work -- it failed on the&amp;nbsp;&lt;U&gt;second&lt;/U&gt; loop. &amp;nbsp;Now, I've never done Finite A/D sampling under program control before (I usually use Continuous Samples), so I wondered "Maybe I need the Start and Stop Task function&amp;nbsp;&lt;U&gt;inside&lt;/U&gt; the loop". &amp;nbsp;And then it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my slightly-revised code (I did some wiring cleanup). &amp;nbsp;Note that V_Output, V_Control, and V_Sample are the names of the DAQmx Tasks I created (where the "DAQmx Details" are hidden). &amp;nbsp;I did my best to get rid of frames, keeping only the one needed to "separate" the AO from the AI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/746acde9fbecaa1d2ede2f18c3041c766ec783f8/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238343369323331344245453534423145373743462f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="Revised AO-AI Routine.png" title="Revised AO-AI Routine.png" /&gt;&lt;/P&gt;&lt;P&gt;Bob Schor&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Bob, thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your example and it works.&lt;/P&gt;&lt;P&gt;Unfortunately the accuracy with SW timing is quite mediocre ... instead of specified &lt;STRONG&gt;50ms&lt;/STRONG&gt; the delay is about &lt;STRONG&gt;75ms&lt;/STRONG&gt; (please the snapshot from oscilloscope).&lt;/P&gt;&lt;P&gt;For our actual testbend is sufficient, but with some advanced features (that we planify to integrate in the future) such accuracy will be probably insufficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's 2nd day I'm searching for a solution with HW timing (i.e. using &lt;STRONG&gt;"Start Trigger"&lt;/STRONG&gt; and &lt;STRONG&gt;"Start.Delay"&lt;/STRONG&gt; property node), but without success: all the examples that I've found until now uses perdefined waveform (i.e. defined &lt;U&gt;before&lt;/U&gt; loop), whereas in my setup output value is generated &lt;U&gt;inside&lt;/U&gt; loop. Have you any experience with &lt;STRONG&gt;"Start Trigger"&lt;/STRONG&gt; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pavel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/02ac6f616e68365e11162bcdf966c47e38db299c/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238353569463131324532314538443432304646372f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="F0000TEK.BMP" title="F0000TEK.BMP" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 15:51:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290639#M961916</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-03T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290716#M961951</link>
      <description>&lt;P&gt;Sorry, I've been fortunate in dealing with "simple timing" situations. &amp;nbsp;However, I'm sure other Forum readers with the proper experience will see this and chime in (and maybe even point out flaws in my code -- where did the extra 25 msec come from?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob Schor&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 17:35:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290716#M961951</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2016-05-03T17:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290806#M961979</link>
      <description>&lt;P&gt;Oops, I spoke too soon -- I should have tested my own code (and my own device). &amp;nbsp;So here's what I did --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I sprinkled 5 High Precision Timers in the code that I posted. &amp;nbsp;Two were back-to-back before the D/A loop to estimate how much time the "Timer" took to produce a time.&lt;/LI&gt;&lt;LI&gt;The third was right after the D/A (I was curious how long it took to output a sample).&lt;/LI&gt;&lt;LI&gt;The fourth was right after the 50 msec delay.&lt;/LI&gt;&lt;LI&gt;The last was right after the 100-point (at 10KHz) A/D sample.&lt;/LI&gt;&lt;LI&gt;All of the Timers were tied to Error lines. &amp;nbsp;The first three were on the Error Line through the D/A function, while the last two were before and after the A/D read.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here are the results after running about 10 seconds (generating about 100 results), expressed as Mean ± Standard Deviation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delay caused by the timers: &amp;nbsp; &amp;nbsp; 2 ± 1 &amp;nbsp; &amp;nbsp;microseconds.&lt;/P&gt;&lt;P&gt;D/A conversion &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp;1.0 ± 0.2 milliseconds&lt;/P&gt;&lt;P&gt;Delay &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp; 56 ± 0.3 milliseconds&lt;/P&gt;&lt;P&gt;A/D conversion &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 100 ± 31 &amp;nbsp;microseconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aha! &amp;nbsp;If the A/D conversion started when I did the DAQmx Read, the timing should have been 10 milliseconds, not 0.1 millisecond. &amp;nbsp;So the code is wrong -- the Start belongs on the other side of the Wait.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's much better. &amp;nbsp;Here are revised timings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delay caused by the timers: &amp;nbsp; &amp;nbsp; 4 ± 2 &amp;nbsp; &amp;nbsp;microseconds.&lt;/P&gt;&lt;P&gt;D/A conversion &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp;0.6 ± 0.05 milliseconds&lt;/P&gt;&lt;P&gt;Delay &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp; 49 ± 0.08 milliseconds&lt;/P&gt;&lt;P&gt;A/D conversion &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp; 18 ± 0.7 &amp;nbsp;milliseconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the Delay is pretty accurate (providing you have the rest of the code right, of course. &amp;nbsp;Yes, now that we are starting the A/D after the delay, we may have to do "timing tests" such as this to figure out how much (8 milliseconds?) is taken up "getting ready" (provided we don't discover how to "start" the A/D but tell it to wait for a hardware trigger signal).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is also not a bad idea to test your code (as I initially failed to do, but now have done), as it might prove to be illuminating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob Schor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 19:45:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290806#M961979</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2016-05-03T19:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290838#M961986</link>
      <description>&lt;P&gt;Pavel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the following&amp;nbsp;is what you were describing in the original message. &amp;nbsp;Generate an AO stimulus, wait&amp;nbsp;50 msec for your system to respond and settle,&amp;nbsp;capture AI to do averaging, output the average as AO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I included partial code below. &amp;nbsp;It's based on expecting the tasks *NOT* to be using any kind of triggering. &amp;nbsp;The AO tasks should be started before the loop, the AI task should be committed before the loop (as shown).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expectation is that the 2nd AO will occur about 60-61 msec after the 1st. &amp;nbsp;50 msec for the explicit delay, about 10 msec more for the 100 samples at 10 kHz. &amp;nbsp;Adjust as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Kevin P&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/5956fbbb174b0e7e37da5331909df2e84f1217ae/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383238383169454436434137323033384339393138352f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="easy sw timing.png" title="easy sw timing.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 20:33:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3290838#M961986</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2016-05-03T20:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291117#M962079</link>
      <description>&lt;P&gt;Thanks Kevin and Bob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the enhanced solution, proposed by Kevin (snippet below) and the delay seems to be perfect ... probably because of using virtual device (I've tried it at home)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try it next Monday on a real device and communicate you the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But besides that do you really consider that for such kind of setup HW synchronization (i.e. triggering with specified delay) is&amp;nbsp;unrealizable ?&lt;/P&gt;&lt;P&gt;I've looked through a certain number of exapmles and all of them use HW synchronization.&lt;/P&gt;&lt;P&gt;Of course all of them use prediefined waveform for DA output (not generated inside a loop as in my case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, this particularity of my setup makes HW synchronization&amp;nbsp;&lt;SPAN&gt;unrealizable ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ad51502c77e5ae7ab8a7889bf9cf7beb144097ac/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383239313469453942453037454346383546454430342f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="acquisition_with_delay_iteration_time_measurement.JPG" title="acquisition_with_delay_iteration_time_measurement.JPG" width="412" height="271" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/01ce446b26cdee2d3fcb7a70efd10d414b9cc4c4/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383239313569374232414330353635364645414544302f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="acquisition_with_delay [Kevin_Price].png" title="acquisition_with_delay [Kevin_Price].png" width="685" height="358" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 10:52:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291117#M962079</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-04T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291157#M962097</link>
      <description>&lt;P&gt;Hi Pavel,&lt;/P&gt;
&lt;P&gt;a few comments:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) The error&amp;nbsp;-200284 was appearing most probably because the trigger works only once, in the beginning of the acquisition. To have it armed again you would need to &lt;A href="https://www.ni.com/en/support/documentation/supplemental/21/retriggerable-tasks-in-ni-daqmx.html" target="_self"&gt;set the task as retriggerable&lt;/A&gt;&amp;nbsp;and use a different signal as trigger (the start trigger will also be generated only once - in the beginning of the acquisition).&lt;/P&gt;
&lt;P&gt;2) If you want your code to be running continuously, the AI acquisition cannot be finite (starting the ascquisition/generation inside the loop is not the best idea, especially if you want to have tight synchronization on the level of ms).&lt;/P&gt;
&lt;P&gt;3) Usually the best way to create unusual timing configurations is to use counters. Counter functionality will depend on the device family -&amp;nbsp;you can find more details&amp;nbsp;on this topic in the manual (information relevant to the X series is here:&amp;nbsp;&lt;A href="https://www.ni.com/docs/en-US/bundle/pcie-pxie-usb-63xx-features/resource/370784k.pdf#page=155" target="_blank" rel="noopener"&gt;https://www.ni.com/docs/en-US/bundle/pcie-pxie-usb-63xx-features/resource/370784k.pdf#page=155&lt;/A&gt; ). The general idea is the following: you configure AO to use the counter output as sampling signal, connect the AI sample clock to the&amp;nbsp;counter input and create a counter task that will output a single pulse with 50ms of low time every time it gets a rising edge on the input. The outcome? AO will output a signle sample exactly 50ms after the AI is sampled (this is the effective delay we create). Please let me know if something is unclear. I can elaborate more if you are interested.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:36:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291157#M962097</guid>
      <dc:creator>stockson</dc:creator>
      <dc:date>2025-06-04T19:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291300#M962124</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fully in agreement&amp;nbsp;with&amp;nbsp;&lt;EM&gt;stockson&lt;/EM&gt; that continuous AI&amp;nbsp;would be a better choice. &amp;nbsp;I didn't want to get into it b/c it looks like your app wants to ignore most of the AI data, and only pay attention for about 10 msec out of every 100. &amp;nbsp;The way *I* would approach that situation is to use DAQmx Read properties to always ask for the most recent sampled data rather than gathering a continuous stream and throwing out 90% of it after the fact. &amp;nbsp;Here's an &lt;A href="https://ni.lithium.com/t5/Multifunction-DAQ/Question-Regarding-Continuous-Acquisition-via-NI-DAQmx/m-p/2121320/highlight/true#M72549" target="_blank"&gt;older post&lt;/A&gt; that shows how to set that up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As to the hardware timing sync, yes there are probably ways to accomplish what you need but it'll take a relatively advanced bit of DAQmx programming to pull it off. &amp;nbsp;Doable, but not trivial. &amp;nbsp;Spend a little time learning about &amp;nbsp;"Hardware Timed Single Point" sampling mode, which is what you'll need for the AO task(s). &amp;nbsp;On a given board you'll probably&amp;nbsp;only be allowed a single AO task that uses hw timing, so you'll need to figure out&amp;nbsp;how to handle 2 channels of output that need to be updated at different instants. &amp;nbsp;(Hint:&amp;nbsp;calculate once, write twice) &amp;nbsp; The exact timing relationship between the AO and AI isn't clear to me yet either, but you'll probably&amp;nbsp;want something more repeatable than a msec wait timer. &amp;nbsp;Syncing them in hw is complicated by the fact that you want the AI running at a much faster rate so you can do some noise-suppressing averaging. &amp;nbsp;Therefore, the AI and AO can't simply share a sample clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, yes you can probably get there from here, but there's a lot to be learned and tried&amp;nbsp;along the way. &amp;nbsp;I suggest you start by taking&amp;nbsp;the&amp;nbsp;software-timed example&amp;nbsp;and converting the AI to a continuous sampling task. &amp;nbsp; Next, I'd suggest playing around with hw-timed single point AO as a separate dedicated program before integrating it in with this one. &amp;nbsp; And so on, one step at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Kevin P&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 15:23:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3291300#M962124</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2016-05-04T15:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3292740#M962648</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;stockson a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;Hi Pavel,&lt;/P&gt;
&lt;P&gt;a few comments:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) The error&amp;nbsp;-200284 was appearing most probably because the trigger works only once, in the beginning of the acquisition. To have it armed again you would need to &lt;A href="https://www.ni.com/en/support/documentation/supplemental/21/retriggerable-tasks-in-ni-daqmx.html" target="_self"&gt;set the task as retriggerable&lt;/A&gt;&amp;nbsp;and use a different signal as trigger (the start trigger will also be generated only once - in the beginning of the acquisition).&lt;/P&gt;
&lt;P&gt;2) If you want your code to be running continuously, the AI acquisition cannot be finite (starting the ascquisition/generation inside the loop is not the best idea, especially if you want to have tight synchronization on the level of ms).&lt;/P&gt;
&lt;P&gt;3) Usually the best way to create unusual timing configurations is to use counters. Counter functionality will depend on the device family -&amp;nbsp;you can find more details&amp;nbsp;on this topic in the manual (information relevant to the X series is here:&amp;nbsp;&lt;A href="https://www.ni.com/docs/en-US/bundle/pcie-pxie-usb-63xx-features/resource/370784k.pdf#page=155" target="_blank" rel="noopener"&gt;https://www.ni.com/docs/en-US/bundle/pcie-pxie-usb-63xx-features/resource/370784k.pdf#page=155&lt;/A&gt; ). The general idea is the following: you configure AO to use the counter output as sampling signal, connect the AI sample clock to the&amp;nbsp;counter input and create a counter task that will output a single pulse with 50ms of low time every time it gets a rising edge on the input. The outcome? AO will output a signle sample exactly 50ms after the AI is sampled (this is the effective delay we create). Please let me know if something is unclear. I can elaborate more if you are interested.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi Stockson,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to implement your scenario.&lt;/P&gt;
&lt;P&gt;Indeed there are points that I didn't properly understand.&lt;/P&gt;
&lt;P&gt;Here is a staff that I've composed, based on your propositions (at least as I understood them).&lt;/P&gt;
&lt;P&gt;As you can it's only rough draft ... only few connetctions are wired.&lt;/P&gt;
&lt;P&gt;For example for me it was not clear 2nd point: sampling source management for AI ?&lt;/P&gt;
&lt;P&gt;Counter task is configured as follows:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Output terminal: &lt;STRONG&gt;PFI12&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Trigger Source: &lt;STRONG&gt;PFI0&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Edge: rising&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Trigger Type: Digital Edge&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;High time: 50msec&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Low time: 50msec&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Idle State: high&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should I create an additional task that&amp;nbsp;outputs square waveform (with period that corresponds to the timing of my while loop on &lt;STRONG&gt;PFI0&lt;/STRONG&gt; output) and also make it sampling source for &lt;STRONG&gt;AI&lt;/STRONG&gt; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pavel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="read_input_with_delay_HW (0) [Stockson scenario].png" style="width: 798px;"&gt;&lt;img src="https://ip1.i.lithium.com/ddb99219d3b5a8375b6ac5220a654e8f5a447cd0/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383331363069344244443742433842413331324235352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="read_input_with_delay_HW (0) [Stockson scenario].png" alt="read_input_with_delay_HW (0) [Stockson scenario].png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:37:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3292740#M962648</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2025-06-04T19:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3292746#M962651</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Kevin_Price a écrit&amp;nbsp;:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fully in agreement&amp;nbsp;with&amp;nbsp;&lt;EM&gt;stockson&lt;/EM&gt; that continuous AI&amp;nbsp;would be a better choice. &amp;nbsp;I didn't want to get into it b/c it looks like your app wants to ignore most of the AI data, and only pay attention for about 10 msec out of every 100. &amp;nbsp;The way *I* would approach that situation is to use DAQmx Read properties to always ask for the most recent sampled data rather than gathering a continuous stream and throwing out 90% of it after the fact. &amp;nbsp;Here's an &lt;A href="https://ni.lithium.com/t5/Multifunction-DAQ/Question-Regarding-Continuous-Acquisition-via-NI-DAQmx/m-p/2121320/highlight/true#M72549" target="_blank"&gt;older post&lt;/A&gt; that shows how to set that up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As to the hardware timing sync, yes there are probably ways to accomplish what you need but it'll take a relatively advanced bit of DAQmx programming to pull it off. &amp;nbsp;Doable, but not trivial. &amp;nbsp;Spend a little time learning about &amp;nbsp;"Hardware Timed Single Point" sampling mode, which is what you'll need for the AO task(s). &amp;nbsp;On a given board you'll probably&amp;nbsp;only be allowed a single AO task that uses hw timing, so you'll need to figure out&amp;nbsp;how to handle 2 channels of output that need to be updated at different instants. &amp;nbsp;(Hint:&amp;nbsp;calculate once, write twice) &amp;nbsp; The exact timing relationship between the AO and AI isn't clear to me yet either, but you'll probably&amp;nbsp;want something more repeatable than a msec wait timer. &amp;nbsp;Syncing them in hw is complicated by the fact that you want the AI running at a much faster rate so you can do some noise-suppressing averaging. &amp;nbsp;Therefore, the AI and AO can't simply share a sample clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, yes you can probably get there from here, but there's a lot to be learned and tried&amp;nbsp;along the way. &amp;nbsp;I suggest you start by taking&amp;nbsp;the&amp;nbsp;software-timed example&amp;nbsp;and converting the AI to a continuous sampling task. &amp;nbsp; Next, I'd suggest playing around with hw-timed single point AO as a separate dedicated program before integrating it in with this one. &amp;nbsp; And so on, one step at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Kevin P&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your suggestion on HW and it works quite properly - the delay is about 60 ms (measured with oscilloscope) that is&amp;nbsp;explained by conversion time.&lt;/P&gt;&lt;P&gt;Concerning my application, actually it's more simple that I've exposed in my previous posts.&lt;/P&gt;&lt;P&gt;The idea is taking measurement in loop:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;AO generates a&amp;nbsp;voltage&lt;/LI&gt;&lt;LI&gt;Testbend reacts to this stimulus (settling time isn't defined, so the acquisition delay should be adjustable)&lt;/LI&gt;&lt;LI&gt;System acqires input data - many samples (adjustable ... can be until the end of the while loop iteration)&lt;/LI&gt;&lt;LI&gt;Acquired data is averaged and then processed&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;As for me this kind of scenario is one of the most generic, so I was surprised that there is no templates for it (here I mean HW synchronization).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 10:51:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3292746#M962651</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-09T10:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3293228#M962834</link>
      <description>&lt;P&gt;Hi Pavel,&lt;/P&gt;
&lt;P&gt;The configuration of the counter should be&amp;nbsp;&lt;EM&gt;Retriggerable Single Pulse Generation&lt;/EM&gt; and the trigger should be set to AI sample clock (you started well; if you need help there is an example in LabVIEW that shows how to do it - &lt;EM&gt;Counter - Single Pulse Output&lt;/EM&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would result in something like this (screenshot is taken from the M Series manual):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/21cad86ee6ac867fceec249352d602d6a3c76c9f/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383331393969444636304138303045343535434236342f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="Untitled.png" title="Untitled.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to worry about AI clock, it will be generated automatically.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 08:10:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3293228#M962834</guid>
      <dc:creator>stockson</dc:creator>
      <dc:date>2016-05-10T08:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx: read value(s) with delay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3293298#M962855</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;stockson a écrit&amp;nbsp;:&lt;BR /&gt;&lt;P&gt;Hi Pavel,&lt;/P&gt;&lt;P&gt;The configuration of the counter should be&amp;nbsp;&lt;EM&gt;Retriggerable Single Pulse Generation&lt;/EM&gt; and the trigger should be set to AI sample clock (you started well; if you need help there is an example in LabVIEW that shows how to do it - &lt;EM&gt;Counter - Single Pulse Output&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would result in something like this (screenshot is taken from the M Series manual):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need to worry about AI clock, it will be generated automatically.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Hi Stockson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for feedback.&lt;/P&gt;&lt;P&gt;I've tried "Retriggerable Single Pulse Generation" example. It works.&lt;/P&gt;&lt;P&gt;Then I've tried to implement the similar staff for my case.&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/84ededfe8982e018750d3ce163cc27b10eb12ca5/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383332313369393846314635393942423734434642462f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="read_input_with_delay_HW (1) [Stockson scenario].png" title="read_input_with_delay_HW (1) [Stockson scenario].png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately an error is generated on running:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/b1e021f0ed095b02d1a9327f09a42666a84d8844/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383332313469393735443335304142384146393434452f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="counter_task_settings_error.JPG" title="counter_task_settings_error.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't understand what this error means, as I've only one virtual channel. Here is snapshot from Counter task settings:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/8c2fd72ae56ab5d8423a8b5f3079204c6fc8486a/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31383332313569373241324343374346414346323442312f696d6167652d73697a652f6f726967696e616c3f763d76322670783d2d31" border="0" alt="counter_task_settings.JPG" title="counter_task_settings.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 11:01:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/DAQmx-read-value-s-with-delay/m-p/3293298#M962855</guid>
      <dc:creator>Pavel_47</dc:creator>
      <dc:date>2016-05-10T11:01:58Z</dc:date>
    </item>
  </channel>
</rss>

