<?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 Erratic AI startup in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Erratic-AI-startup/m-p/1732198#M608317</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am somewhat confused as to what is happening in my program when I read AI from the USB 6221.&lt;/P&gt;
&lt;P&gt;A code fragment is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Samples per Channel=1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Sample rate=1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;AI I/O reads channels 0:1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Timeout = -1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Samples2Get = -1 (Read all)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;SampleIntervalMD =0.5 seconds&lt;/P&gt;
&lt;P&gt;The "Wait before Reading" was introduced to give the board some time to accumulate data after the "DAQmx Start Task" before I enter the While to do "DAQmx Read".&lt;/P&gt;
&lt;P&gt;The sequence structure first&amp;nbsp;loops until the&amp;nbsp;next SampleInterval increment has passed, then continues to the DAQmx Read seen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do some processing of the waveform before I go to the "Loop until next SampleInterval increment has passed" again. One of the things I do is to extract the mean from the waveform (that's all I need) and process that further. Another thing is that I record the amount of data fetched each cycle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With my precautions I expected the buffer to be ready when I get there, but my first few rounds through the while give me the following number of AI readings (per channel) - 0, 0, 503, 484, 500, 499, 500...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changing&amp;nbsp;the reading Interval to 5 seconds yields the following number of AI readings - 0, 5004, 2, 4981, 5000, 5000...&lt;/P&gt;
&lt;P&gt;(These numbers are typical, but vary from time to time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q1- I find it odd that I get, despite my efforts, Zero Readings on the first DAQmq Read (I would rather have expected too many).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q2- And what could possibly be the reason for obtaining Zero Readings the second round through (first example), or a full&amp;nbsp; buffer the second time and then Two readings on the third pass (as in the second example).&lt;/P&gt;
&lt;P&gt;In fact it seems that the pattern, although irregular from time to time, follows the general rule of Zero the first time through, then a small Overshoot, then Too few and finally "it" settles on the expected number of readings each time through (give or take one). I cannot imagine how there could be a "Cycling/settling effect" on the order of 5&amp;nbsp; five second cycles...??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q3- If I change to read some predefined number of samples and let too many data accumulate before I read it out (by extending the Sample Interval)&amp;nbsp;I am alerted that data has been overwritten (fair enough). However, with the other settings as above this seems to happen only until some 9000-10000 values have accumulated (abouts). I expected it to happen much sooner. Why is that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q4- The Alert I get refers to data in the buffer being overwritten, but I have not found any reference to how that buffer size is being determined. Is it related to something I can change?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The program is working good enough so my questions are mostly to satisfy my own curiosity.&lt;/P&gt;
&lt;P&gt;If you could shed some light on this issue I would be very grateful. &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;Kind regards / Ake&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2011 14:42:47 GMT</pubDate>
    <dc:creator>Ake46</dc:creator>
    <dc:date>2011-10-07T14:42:47Z</dc:date>
    <item>
      <title>Erratic AI startup</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Erratic-AI-startup/m-p/1732198#M608317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am somewhat confused as to what is happening in my program when I read AI from the USB 6221.&lt;/P&gt;
&lt;P&gt;A code fragment is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Samples per Channel=1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Sample rate=1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;AI I/O reads channels 0:1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Timeout = -1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Samples2Get = -1 (Read all)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;SampleIntervalMD =0.5 seconds&lt;/P&gt;
&lt;P&gt;The "Wait before Reading" was introduced to give the board some time to accumulate data after the "DAQmx Start Task" before I enter the While to do "DAQmx Read".&lt;/P&gt;
&lt;P&gt;The sequence structure first&amp;nbsp;loops until the&amp;nbsp;next SampleInterval increment has passed, then continues to the DAQmx Read seen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do some processing of the waveform before I go to the "Loop until next SampleInterval increment has passed" again. One of the things I do is to extract the mean from the waveform (that's all I need) and process that further. Another thing is that I record the amount of data fetched each cycle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With my precautions I expected the buffer to be ready when I get there, but my first few rounds through the while give me the following number of AI readings (per channel) - 0, 0, 503, 484, 500, 499, 500...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changing&amp;nbsp;the reading Interval to 5 seconds yields the following number of AI readings - 0, 5004, 2, 4981, 5000, 5000...&lt;/P&gt;
&lt;P&gt;(These numbers are typical, but vary from time to time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q1- I find it odd that I get, despite my efforts, Zero Readings on the first DAQmq Read (I would rather have expected too many).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q2- And what could possibly be the reason for obtaining Zero Readings the second round through (first example), or a full&amp;nbsp; buffer the second time and then Two readings on the third pass (as in the second example).&lt;/P&gt;
&lt;P&gt;In fact it seems that the pattern, although irregular from time to time, follows the general rule of Zero the first time through, then a small Overshoot, then Too few and finally "it" settles on the expected number of readings each time through (give or take one). I cannot imagine how there could be a "Cycling/settling effect" on the order of 5&amp;nbsp; five second cycles...??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q3- If I change to read some predefined number of samples and let too many data accumulate before I read it out (by extending the Sample Interval)&amp;nbsp;I am alerted that data has been overwritten (fair enough). However, with the other settings as above this seems to happen only until some 9000-10000 values have accumulated (abouts). I expected it to happen much sooner. Why is that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q4- The Alert I get refers to data in the buffer being overwritten, but I have not found any reference to how that buffer size is being determined. Is it related to something I can change?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The program is working good enough so my questions are mostly to satisfy my own curiosity.&lt;/P&gt;
&lt;P&gt;If you could shed some light on this issue I would be very grateful. &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;Kind regards / Ake&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2011 14:42:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Erratic-AI-startup/m-p/1732198#M608317</guid>
      <dc:creator>Ake46</dc:creator>
      <dc:date>2011-10-07T14:42:47Z</dc:date>
    </item>
  </channel>
</rss>

