<?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: Triggered AI Read + While Loop? in LabVIEW</title>
    <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322280#M166326</link>
    <description>&lt;DIV&gt;why couldnt you use the Retrevial complete boolean output on the AI read to sense when you are done&lt;/DIV&gt;
&lt;DIV&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I'm using DAQmx and I don't see such an output.&amp;nbsp; This is exactly what I am looking for though.&amp;nbsp; Is there anything like this in the new DAQmx api?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Dave&lt;/DIV&gt;</description>
    <pubDate>Wed, 08 Feb 2006 19:48:05 GMT</pubDate>
    <dc:creator>wickwack2003</dc:creator>
    <dc:date>2006-02-08T19:48:05Z</dc:date>
    <item>
      <title>Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322159#M166275</link>
      <description>&lt;DIV&gt;I would like to be able to monitor the clicks of buttons on my main VI panel while it is waiting for the triggered AI read to happen.&amp;nbsp; If I put a while-loop with the AI read block, the loop will continue forever and the VI execution will never make it out of the current frame.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Can you suggest a way to be able to do stuff while the AI Read is waiting for a trigger?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Dave&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 16:33:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322159#M166275</guid>
      <dc:creator>wickwack2003</dc:creator>
      <dc:date>2006-02-08T16:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322196#M166289</link>
      <description>You could have your Read be in a subVI and onyl execute the read once a
button was pressed or some other event (using an event
structure).&amp;nbsp; Another good structure to use is the
producer/consumer set up, but it can get a little more complicated.&lt;BR /&gt;
&lt;BR /&gt;
You may also consider running 2 while loops in parallel to execute the
counting of clicks and the reading at the same time (but that would
usually mean that both are running at the same time).&lt;BR /&gt;
&lt;BR /&gt;
You could also do a while loop with a case structure in it.&amp;nbsp; The
while loop would contain the code for counting and the case structure
could check if the Rewad had been triggered yet.&amp;nbsp; If it has not
been triggered, do nothing, if it has, then execute the read.&lt;BR /&gt;
&lt;BR /&gt;
There are many possibilities, if you want to see some examples, let me
know and i can make up some VIs quick to illustrate what I mentioned.&lt;BR /&gt;
&lt;BR /&gt;
Kenny&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 17:33:37 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322196#M166289</guid>
      <dc:creator>Kenny_K</dc:creator>
      <dc:date>2006-02-08T17:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322209#M166296</link>
      <description>&lt;DIV&gt;But how do I know when the triggered AI Read has completed?&amp;nbsp; It is hardware triggered and is confirgured in the MAX as such.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Dave&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 17:52:28 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322209#M166296</guid>
      <dc:creator>wickwack2003</dc:creator>
      <dc:date>2006-02-08T17:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322250#M166313</link>
      <description>&lt;DIV&gt;The hardware triggers the Read, does it also tell it to stop??&amp;nbsp; Or is there a set number of data points that you aquire or a set amount of time that you have it to aquire??&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;If you ahve a time that you need to aquire, you could use a Tick Count (ms) VI to count a certain amount of time and compare that to a constant and wire it to the stop button of the while loop.&amp;nbsp; Or if it is a set number of data points, you could do something similar and wire the iteration counter of the while loop to a comparision and to the stop button.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Or you could have another button that tells the AI read to stop taking data so you could stop it at any time.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Kenny&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 19:06:30 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322250#M166313</guid>
      <dc:creator>Kenny_K</dc:creator>
      <dc:date>2006-02-08T19:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322251#M166314</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Sorry I should have been clearer.&amp;nbsp; There is only one sample being read, so there is no while-loop containing the read.&amp;nbsp; Would it be possible to use the event handling mechanism to sense the value-change in the error out of the AI Read block?&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2006 19:09:04 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322251#M166314</guid>
      <dc:creator>wickwack2003</dc:creator>
      <dc:date>2006-02-08T19:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322275#M166322</link>
      <description>&lt;DIV&gt;If you wanted to try that approach you can, but I think that you would have to add in a simple error handler after the AI read and on the Simple error handler, there is an output "error?" which is a boolean.&amp;nbsp; You can wire an indicator to that and then the event structure can sense a value change in the indicator.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;A thought came to mind, why couldnt you use the Retrevial complete boolean output on the AI read to sense when you are done?&amp;nbsp; You could wire an indicator to it to let the operator know that the read is complete or you could have it stop the While loop that has the monitoring of buttons in it.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;How many buttons/what are the buttons needed for that you need to monitor them??&amp;nbsp; If you need to do a bunch of tasks that may need to be done AFTER the AI Read, then it would probably be best to use a producer consumer structure.&amp;nbsp; That way you could do many things and ahve the AI Read handled in the background.&amp;nbsp; But if you jsut ahve a start/stop button, then a while lopp and an event structure will work just fine.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I attached a simple VI to give some ideas on things you could do.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Kenny&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 19:39:05 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322275#M166322</guid>
      <dc:creator>Kenny_K</dc:creator>
      <dc:date>2006-02-08T19:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322280#M166326</link>
      <description>&lt;DIV&gt;why couldnt you use the Retrevial complete boolean output on the AI read to sense when you are done&lt;/DIV&gt;
&lt;DIV&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I'm using DAQmx and I don't see such an output.&amp;nbsp; This is exactly what I am looking for though.&amp;nbsp; Is there anything like this in the new DAQmx api?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Dave&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 19:48:05 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322280#M166326</guid>
      <dc:creator>wickwack2003</dc:creator>
      <dc:date>2006-02-08T19:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322321#M166351</link>
      <description>&lt;DIV&gt;Try this VI.&amp;nbsp; I know that it seems like a lot of work to get a simple boolean out, but ti was what i thought of off the top of my head.&amp;nbsp; I am sure ther are other ways to do it.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Sorry, I assumed when you said AI Read that you were using traditional DAQ.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Kenny&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2006 20:32:14 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/322321#M166351</guid>
      <dc:creator>Kenny_K</dc:creator>
      <dc:date>2006-02-08T20:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Triggered AI Read + While Loop?</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/324262#M167214</link>
      <description>I was looking through some of the examples shipped with LV 8.0 to find
an answer to a question I had and I found that there is a VI that is
Daqmx Task done, located in Measurement I/O &amp;gt; Daqmx &amp;gt; Task
Config/Ctrl.&amp;nbsp; That will give you a boolean out when the task is
done.&amp;nbsp; The example is "Cont Gen Voltage Wfm-Int Clk-Analog
Start.vi"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Kenny&lt;BR /&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Feb 2006 21:48:00 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggered-AI-Read-While-Loop/m-p/324262#M167214</guid>
      <dc:creator>Kenny_K</dc:creator>
      <dc:date>2006-02-13T21:48:00Z</dc:date>
    </item>
  </channel>
</rss>

