<?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 Re: Deterministic loop is delayed when continuously rewriting AO's buffer in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2501296#M762169</link>
    <description>&lt;P&gt;... and a simplified VI reproducing the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After about 5s the loop shows its first delay.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2013 08:48:48 GMT</pubDate>
    <dc:creator>sls__</dc:creator>
    <dc:date>2013-07-24T08:48:48Z</dc:date>
    <item>
      <title>Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2500358#M761989</link>
      <description>&lt;P&gt;Hello everyone!&lt;BR /&gt;&lt;BR /&gt;I am using the RT module for neurofeedback: Analyzing brain activity and then giving the user auditory feedback about it.&lt;BR /&gt;My RT target is a desktop pc and I use the typical deterministic + nondeterministic loop structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want is to continuously output a pure tone. The amplitude of the tone is calculated in real time and depends on some feature of the user's brain activity. It should vary smoothly to avoid click-like artifacts. &lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Since there are no sound VIs in the RT module, I use the DAQmx write VI (analog output) with regeneration enabled. The sample mode is continuous.&lt;BR /&gt;&lt;BR /&gt;Before the first iteration, I generate a sine wave of an appropiate length (some hundred samples) and amplitude 1. Then, on each iteration, I compute the new value of the amplitude and multiply the sine wave with a linear ramp so that I get a smooth amplitude modulation. On the same iteration I write this new piece of data with the DAQmx write VI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WIth this approach my timed loop gets delayed periodically, even thought the cpu load stays below 20%. It seems that continuously rewriting the device's buffer is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a cleverer way of doing what I want? For instance: Could I write the pure tone only in the beginning and then control the amplitude by setting a gain? I have seen that a gain property exists ( &lt;A href="http://zone.ni.com/reference/en-XX/help/370469AA-01/daqmxprop/attr118/" target="_blank"&gt;http://zone.ni.com/reference/en-XX/help/370469AA-01/daqmxprop/attr118/&lt;/A&gt; ) but I fail to find it. I am using LV 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will be very grateful for any ideas!&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2013 15:42:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2500358#M761989</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-07-23T15:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2501250#M762159</link>
      <description>&lt;P&gt;ok, the short version of the above:&lt;/P&gt;
&lt;P&gt;I have an AO task in continuous sample mode. Regeneration is enabled. In a timed loop of period ~10 ms I use the DAQmx write VI to update the buffer on each iteration. This doesn't produce noticeable CPU loads, yet the timed loop is periodically delayed. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better/faster/alternative way to update the AO buffer?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully someone has an idea... Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 08:15:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2501250#M762159</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-07-24T08:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2501296#M762169</link>
      <description>&lt;P&gt;... and a simplified VI reproducing the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After about 5s the loop shows its first delay.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 08:48:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2501296#M762169</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-07-24T08:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2507822#M763563</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the problem are the buffer on the daq device.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From LV - Help:&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;H2&gt;Output Tasks&lt;/H2&gt;
&lt;P class="Body"&gt;For generations, the amount of data you write before starting a generation determines the size of the buffer. The first call to a Multiple Samples version of the Write function/VI creates a buffer and determines its size.&lt;/P&gt;
&lt;P class="Body"&gt;You also can use the Output Buffer Config function/VI to create an output buffer. If you use this function/VI, you must use it before writing any data.&lt;/P&gt;
&lt;P class="Body"&gt;The &lt;STRONG&gt;samples per channel&lt;/STRONG&gt; attribute/property on the Timing function/VI does not determine the buffer size for output. Instead it is the total number of samples to generate. If &lt;EM&gt;n&lt;/EM&gt; is your buffer size, setting &lt;STRONG&gt;samples per channel&lt;/STRONG&gt; to 3×&lt;EM&gt;n&lt;/EM&gt; generates the data in the buffer exactly three times. To generate the data exactly once, set &lt;STRONG&gt;samples per channel&lt;/STRONG&gt; to &lt;EM&gt;n&lt;/EM&gt;.&lt;/P&gt;
&lt;P class="Body"&gt;NI-DAQmx does not create a buffer when the &lt;STRONG&gt;sample mode&lt;/STRONG&gt; on the Timing function/VI is set to Hardware Timed Single Point.&lt;/P&gt;
&lt;P class="Body"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Body"&gt;"&lt;/P&gt;
&lt;P class="Body"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Body"&gt;To your example. I would connect the timing source from my daq device to the timed loop, so both, the DAQ device and the timed loop have the same source.&lt;BR /&gt;And I located manually the buffer. In your first example the buffer was only 300 samples big. I made a buffer that was 6 times greater.&lt;/P&gt;
&lt;P class="Body"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Body"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2013 14:36:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2507822#M763563</guid>
      <dc:creator>BRennhofer</dc:creator>
      <dc:date>2013-07-30T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2508146#M763614</link>
      <description>&lt;P&gt;Hey Rennhofer, thanks for the helpful suggestions!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess was that a small buffer should suffice, since I would never write more than those 300 points. Could you explain to me what is the advantage of a bigger buffer?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get a problem opening your vi, it tells me it is version 13.0 (didn't know it was out already!) Could you upload it again in version 12? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2013 17:38:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2508146#M763614</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-07-30T17:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2508192#M763624</link>
      <description>&lt;P&gt;Hi sls,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The advantage of a larger buffer size is a lower frequency of buffer updates required for&amp;nbsp;the same time interval. (Of course, the down side is that you have&amp;nbsp;a reduction in the&amp;nbsp;granularity of control over the waveform.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are experiencing performance problems, a larger buffer size is a good place to start (-- assuming your application can tolerate a slower change of the waveform output). While processor speed is a good indicator of system throughput, it isn't always the only consideration. Loading the AO buffer repeatedly may not require max out your average CPU throughput, but there may be a burst throughput requirement that you are not meeting with your current configuration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I were you, I would start by bumping up the buffer size and seeing if that helps. If so, then you can inch it back down to find the best throughput/performance compromise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, I once worked on a high-speed&amp;nbsp;robot &amp;amp; vision application installed on a custom-built quad-core Xeon system running RT. Although the 4 processors were running at less than 40% most of the time, we were never able to meet the throughput requirements. After upgrading to 8 cores, processor load dropped quite dramatically. Peak load was occassionally around 10% on some processors, but generally less than 5% most of the time. After the upgrade, we were able to meet the throughput requirements, and even had enough overhead to "beef up" the analysis algorithms. The moral of the story: processor load is an "averaged" indication of what is going on under the hood. If your&amp;nbsp;system cannot keep up with the&amp;nbsp;peak loads required by your application, you may experience difficulties. (At least, that was my&amp;nbsp;take-away from the experience...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, best of luck sorting out&amp;nbsp;this issue.&lt;/P&gt;
&lt;P&gt;--Dave&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2013 18:02:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2508192#M763624</guid>
      <dc:creator>The_Seeker</dc:creator>
      <dc:date>2013-07-30T18:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2519616#M765923</link>
      <description>&lt;P&gt;@Seeker: Nice to know that I am not the only one experiencing strange behaviours!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks both of you for the helpful comments!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expanding the buffer has indeed helped solving the problem. It works using a buffer 6-10 times larger than the signal size &lt;EM&gt;and&lt;/EM&gt; setting the "Do not allow regeneration" property. Allowing regeneration slowly consumes the free space. Yeah! Now the available buffer space oscillates at high values - Thanks for the slide, Rennhofer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;... But I don't get why it works. The update frequency is just like before, so I would expect the same load due to writing. I guess that the write VI does something extra when the buffer is getting full?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have another question! Later in my original code I need to stop the signal generation and restart the task after a while. If I try that, I get an error -200290 (generation stopped) when I try to write to the buffer again. It doesn't happen if I do allow regeneration - but then my first problem would be back. Any suggestions on how to deal with this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I can think of two workarounds that I would prefer to avoid: Outputting an array of zeros while the program pauses or using a huge buffer size with regeneration on.)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 17:09:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2519616#M765923</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-08-09T17:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520244#M766063</link>
      <description>&lt;P&gt;Hi sls&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm back in the office on monday. So I will&amp;nbsp;take care&amp;nbsp;your question and VI . If I found a solution I will write back.&lt;/P&gt;
&lt;P&gt;Sorry for my first VI I was uploaded in LV 2013. I'm an AE at NI so I got a prereleas of LabVIEW.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;BR /&gt;Bernhard&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2013 19:13:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520244#M766063</guid>
      <dc:creator>BRennhofer</dc:creator>
      <dc:date>2013-08-10T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520278#M766067</link>
      <description>&lt;P&gt;Hi sls_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your comment:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"I guess that the write VI does something extra when the buffer is getting full?"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess is that multiple calls are being made to the memory manager, requesting more memory. As I understand it, LV asks the memory manager to allocate a chunk that is "expected to be adequate". If it needs more, it has to go back again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have allocated a buffer 6-10 times larger than the signal size, and you aren't regenerating, I'm guessing you are avoiding subsequent memeory manager calls (which can be slow). Apparently, when regenerating, it would appear that the memory manager may be called repeatedly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would explain what you are seeing -- although only the LabVIEW development team knows for sure...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best of luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Dave&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>Sat, 10 Aug 2013 22:57:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520278#M766067</guid>
      <dc:creator>The_Seeker</dc:creator>
      <dc:date>2013-08-10T22:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520744#M766159</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with seeker and his arguments. But to be sure we have to discuss with the NI R&amp;amp;D Team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To the error -200290. You could use the regeneration mode and use following settings:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/3c34d52fbae55b1f5189dc1a4ac1f21dc62ee24a/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31313734383069354638303444373932463541443744392f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Settings.PNG" title="Settings.PNG" align="middle" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this settings the date in the onboard memory is allways filled and you have also enough speed while the transfer is directly above the DMA. But attention! You have only 8 DMAs on a PC system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;kind regards&lt;BR /&gt;Bernhard&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 07:55:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520744#M766159</guid>
      <dc:creator>BRennhofer</dc:creator>
      <dc:date>2013-08-12T07:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520746#M766160</link>
      <description>&lt;P&gt;some interest links:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 class="wp-title"&gt;&lt;FONT size="3"&gt;Configuring the Data Transfer Request Condition Property in NI-DAQmx&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;A href="http://digital.ni.com/public.nsf/allkb/45A7AC6B59E026B386256F90006DAA49" target="_blank"&gt;http://digital.ni.com/public.nsf/allkb/45A7AC6B59E026B386256F90006DAA49&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;FONT size="4"&gt;Data Transfer Request Condition for Continuous Analog Output using NI-DAQmx&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;A href="http://digital.ni.com/public.nsf/allkb/45A7AC6B59E026B386256F90006DAA49" target="_blank"&gt;http://digital.ni.com/public.nsf/allkb/45A7AC6B59E026B386256F90006DAA49&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 07:56:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2520746#M766160</guid>
      <dc:creator>BRennhofer</dc:creator>
      <dc:date>2013-08-12T07:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2521356#M766270</link>
      <description>&lt;P&gt;Dankeschön, Bernhard (I guess you are german &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those links were very explanatory. I am still somewhat lost, but we're getting closer to solving this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your suggested parameters work! In the simplified VI as well as in the original VI. Unfortunately, the first iterations output the same signal once or several times. Additionally, if I call the DAQmx Stop Task VI and restart the task after a while, the first piece of signal that comes out belongs to the old update. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can avoid this by using the following configuration: no regeneration, DMA, condition = onboard memory empty. The available space still gets consumed, but only very slowly, so it's OK. BUT: If I use this configuration in my original code, then things get weird, and I get errors -200290, -200018 and -200016 depending partly on the sampling frequency chosen, and partly on things that I haven't been able to track down.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, to be more precise: In the original code, the AO is generated in a first round without problems. Then, a pause follows, and the AO is generated again. This time there is more computation going on in parallel, but I don't feel that it is so much that the computer couldn't handle it - in fact, the timed loop doesn't get delayed anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My confusion arises from the fact that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Regeneration works fine (though I haven't checked the latency yet) in the case where more computation is going on. However, it produces bad first iterations, regardless of the computational load. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- No regeneration fails in the case with more computation, but the first iterations (when it works) are as desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the computer can solve the two pieces of what I need separately. Is there a way of getting the best of the two options?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 16:06:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2521356#M766270</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-08-12T16:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2522798#M766463</link>
      <description>&lt;P&gt;Sorry, that was wrong! I had a mistake in the original VI and I wasn't monitoring all missed periods. I would like to upload that VI, but it is a true monster mammoth...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, the things look like this: In the original VI, I start the task once (phase I), stop it after some seconds, and restart it again, this time with more computation going on in parallel (phase II). It is nevertheless not &lt;EM&gt;so much&lt;/EM&gt; computation we're talking about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All configurations work fine with phase I.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In phase II, the only configuration not delaying the timed loop or throwing an error is Bernhard's (DMA, reg, memory half full or less). The problem: Since the onboard FIFO is more than half full, the VI outputs always a piece of old data when restarted. I also haven't measured the latency, but I expect some.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to set the transfer condition to "onboard memory empty" to avoid having old data played at the beginning. The timed loop then gets delayed in the first iteration or couple of iterations, the VI throws a warning 200015 and then works fine until the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I disable regeneration, no matter what the transfer condition is, the timed loop is delayed, an error -200290 is thrown, and nothing is output anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, this makes some more sense now. In the line same of what The_Seeker commented, it seems that the write VI produces a peak just at the beginning of phase II and behaves fine from then on. Setting the condition to half full or less takes care of this peak, but leaves the buffer half full with old data. Mmmh....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 10:07:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2522798#M766463</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-08-13T10:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deterministic loop is delayed when continuously rewriting AO's buffer</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2525766#M767103</link>
      <description>&lt;P&gt;Solved!&lt;/P&gt;
&lt;P&gt;This one was subtle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first iteration calls the Write VI after a time t (black line). It loads a full period of data into the board's buffer. The board will be busy until time t after the start of the next iteration (red line).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="display: block; margin-left: auto; margin-right: auto;" src="https://ip1.i.lithium.com/88b7e92bfbc3ef28764b16421c6f4ddb2e6a9fde/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31313739373269363339303843394438333138433246422f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Problem.png" title="Problem.png" width="399" height="94" align="middle" /&gt;Now, since the next iterations contain a little bit more computation, they will need t' &amp;gt; t until they can call the Write VI. By then, the board's buffer is already empty and the AO has crashed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To solve the issue, one has to make sure that t is as large as possible. This way, the following iterations will have plenty of time to load their data into the baord.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came with this solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/4760a84dc798c5b086a9b4854ca5eadfea8b3429/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31313739373469394432384431343933383246353536322f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Sol.png" title="Sol.png" width="810" height="334" align="left" /&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;&amp;nbsp;&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;BR /&gt;No regeneration and transfer condition = memory empty. Fast and with controlled* latency, just the way I wanted it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But it doesn't look too elegant, it blocks execution and it may be problematic if the contents of the middle frame change substantially. Is there any other way to tell the timed loop to run the Start Task VI &lt;EM&gt;just before the end&lt;/EM&gt; of the iteration?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to Bernhard and Seeker for their helpful comments!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*as good as it gets, I guess!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 14:41:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Deterministic-loop-is-delayed-when-continuously-rewriting-AO-s/m-p/2525766#M767103</guid>
      <dc:creator>sls__</dc:creator>
      <dc:date>2013-08-15T14:41:20Z</dc:date>
    </item>
  </channel>
</rss>

