<?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 Continuous Measuring and Logging on Windows OS at High Sample Rate in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4009666#M1146292</link>
    <description>&lt;P&gt;Hallo,&lt;/P&gt;
&lt;P&gt;I am trying to implement a simple program to read an analog input &lt;STRONG&gt;continuously&lt;/STRONG&gt;&amp;nbsp;while at the same time storing the logging the data into the computer, also I would like the measures to have a rather high sampling rate (above 20kHz). My DAQ is a&amp;nbsp;&lt;SPAN&gt;NI cDAQ 9174 with a module NI-9222.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Being an extreme beginner with LabView, I had some look around on examples and existing codes, but I still have problems.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I've understood, for having a high sample rate acquisition on a Windows OS, you would have to use a producer/consumer design pattern.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I tried to implement it, having a while-loop for reading data and one for writing it, using a FIFO queue (as explained here:&amp;nbsp;http://www.ni.com/tutorial/3023/en/). Though I still find myself being unable to save the continuous measurements in a text file. At the moment it looks like it saves me only the amount of samples I've specified at the specified frequency and then it goes into an error state.&amp;nbsp;Also the execution seems to not be stopping when an error is triggered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking for solutions I've saw that the usage of "Express" boxes is not suggested, but as I needed a quick solution I thought I could avoid going into the details and using the NI DAQmx blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help me out in fixing this code (see attachments)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Davide&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 21:29:58 GMT</pubDate>
    <dc:creator>freyda</dc:creator>
    <dc:date>2024-12-19T21:29:58Z</dc:date>
    <item>
      <title>Continuous Measuring and Logging on Windows OS at High Sample Rate</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4009666#M1146292</link>
      <description>&lt;P&gt;Hallo,&lt;/P&gt;
&lt;P&gt;I am trying to implement a simple program to read an analog input &lt;STRONG&gt;continuously&lt;/STRONG&gt;&amp;nbsp;while at the same time storing the logging the data into the computer, also I would like the measures to have a rather high sampling rate (above 20kHz). My DAQ is a&amp;nbsp;&lt;SPAN&gt;NI cDAQ 9174 with a module NI-9222.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Being an extreme beginner with LabView, I had some look around on examples and existing codes, but I still have problems.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I've understood, for having a high sample rate acquisition on a Windows OS, you would have to use a producer/consumer design pattern.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I tried to implement it, having a while-loop for reading data and one for writing it, using a FIFO queue (as explained here:&amp;nbsp;http://www.ni.com/tutorial/3023/en/). Though I still find myself being unable to save the continuous measurements in a text file. At the moment it looks like it saves me only the amount of samples I've specified at the specified frequency and then it goes into an error state.&amp;nbsp;Also the execution seems to not be stopping when an error is triggered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking for solutions I've saw that the usage of "Express" boxes is not suggested, but as I needed a quick solution I thought I could avoid going into the details and using the NI DAQmx blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help me out in fixing this code (see attachments)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Davide&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 21:29:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4009666#M1146292</guid>
      <dc:creator>freyda</dc:creator>
      <dc:date>2024-12-19T21:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Measuring and Logging on Windows OS at High Sample Rate</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4017276#M1149404</link>
      <description>&lt;P&gt;Hi Davide,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if you already solved this problem, since it's been a while, but here goes in case you haven't...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/631472"&gt;@freyda&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;From what I've understood, for having a high sample rate acquisition on a Windows OS, you would have to use a producer/consumer design pattern.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A&amp;nbsp;&lt;A href="https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labview0.html" target="_blank" rel="noopener"&gt;Producer/Consumer&lt;/A&gt;&amp;nbsp;design is indeed a good choice for this kind of thing (although 20kHz should be fine, it's not all that fast, and "above 20kHz" could be anything, so no guarantees &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/631472"&gt;@freyda&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P data-unlink="true"&gt;I tried to implement it, having a while-loop for reading data and one for writing it, using a FIFO queue (as explained here:&amp;nbsp;http://www.ni.com/tutorial/3023/en/). Though I still find myself being unable to save the continuous measurements in a text file. At the moment it looks like it saves me only the amount of samples I've specified at the specified frequency and then it goes into an error state.&amp;nbsp;Also the execution seems to not be stopping when an error is triggered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking for solutions I've saw that the usage of "Express" boxes is not suggested, but as I needed a quick solution I thought I could avoid going into the details and using the NI DAQmx blocks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The code you uploaded (from the point of view of a P/C structure) seems basically fine - you create a Queue, enqueue in the producer and dequeue in the consumer, then log there.&lt;/P&gt;
&lt;P&gt;As a result, I'd strongly suspect your problems come from the Express VIs, or more accurately the "Dynamic Data Type" (blue wire), which hides all sorts of information and generally causes unexpected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DAQmx nodes aren't that difficult to get started with - you might find this guide useful:&amp;nbsp;&lt;A href="https://www.ni.com/en/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-handle-80-percent-of-your-dat.html" target="_blank" rel="noopener"&gt;Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your application, you're probably looking at using the Create Virtual Channel, DAQmx Timing, DAQmx Read and DAQmx Stop + Clear.&lt;/P&gt;
&lt;P&gt;You can take a look at the built-in example file for some tips, see Help &amp;gt; Find Examples... &amp;gt; search for "Voltage - Continuous input".&lt;/P&gt;
&lt;P&gt;This example has a bit more complexity than you really need, but also demonstrates the use of "DAQmx Logging", which&amp;nbsp;&lt;EM&gt;might&amp;nbsp;&lt;/EM&gt;obviate the need for a P/C structure (although I'd suggest you're more flexible sticking with the Producer Consumer as you have now, in case of future changes, but it's up to you).&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2025 02:27:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4017276#M1149404</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2025-05-10T02:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Measuring and Logging on Windows OS at High Sample Rate</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4017289#M1149414</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes at the end I solved using exactly that example in LabView which worked perfectly fine.&lt;/P&gt;
&lt;P&gt;Thank you very much anyway for your inputs on the code &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;Best&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 14:43:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Continuous-Measuring-and-Logging-on-Windows-OS-at-High-Sample/m-p/4017289#M1149414</guid>
      <dc:creator>freyda</dc:creator>
      <dc:date>2020-02-23T14:43:01Z</dc:date>
    </item>
  </channel>
</rss>

