<?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: DAQmx Tasks and Channels in LabWindows/CVI</title>
    <link>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4194469#M89618</link>
    <description>&lt;P&gt;Thanks! I blindly looked and didn't find anything. My solution was to put a wrapper around the handle that included a Boolean flag I would set when the Channel was created. Works, but I like this approach much better!&lt;/P&gt;</description>
    <pubDate>Sun, 28 Nov 2021 01:50:29 GMT</pubDate>
    <dc:creator>LelandDurrette</dc:creator>
    <dc:date>2021-11-28T01:50:29Z</dc:date>
    <item>
      <title>DAQmx Tasks and Channels</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193171#M89602</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;
&lt;P&gt;In order to write a digital output point in DAQmx, I use DAQmxCreateTask to first create a task, then DAQmxCreateDOChan to create the channel.&lt;/P&gt;
&lt;P&gt;I'm working in exception handling as much as possible, and have a need to test a Task for whether it contains any Channels or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the DAQmxCreateTask and DAQmxCreateDOChan in a block that break statements will terminate. If the create task isn't successful, I log an error and break out of the block. If it is successful, I proceed to creating a task. If this is not successful, I again break out of the block and proceed to shutting down the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code that shuts down the program, I have a line that writes to a digital point in this Task and channel. But I need to be able to NOT write the point if the creation of the channel was not successful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can test my TaskHandle to see if the task was created, but if it was, how do I test the TaskHandle to see if a channel was created or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(It throws another error in the shutdown when writing the digital point if the channel failed to create, so I need to not write the point if the channel was not created. How can I tell?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 04:42:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193171#M89602</guid>
      <dc:creator>LelandDurrette</dc:creator>
      <dc:date>2021-11-20T04:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx Tasks and Channels</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193173#M89603</link>
      <description>&lt;P&gt;LabVIEW has a property node for DAQmx Task that can query for the channels contained in the task and the number of channels. There should be something similar in CVI too.&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="santo_13_0-1637385836396.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/c3d5392885b1701de343571d54527804208d76a5/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32393530343069374239414134393638324135414437392f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="santo_13_0-1637385836396.png" alt="santo_13_0-1637385836396.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 05:24:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193173#M89603</guid>
      <dc:creator>santo_13</dc:creator>
      <dc:date>2021-11-20T05:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx Tasks and Channels</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193314#M89605</link>
      <description>&lt;P&gt;Indeed there is!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This instruction will return the number of channels in the task, which in your case can be enough:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DAQmxGetTaskAttribute (..., DAQmx_Task_NumChans, &amp;amp;nchan, ...);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can additionally call the same function with &lt;FONT face="courier new,courier"&gt;DAQmx_Task_Channels&lt;/FONT&gt; attribute to retrieve the name of the channels in the task.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 23:26:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4193314#M89605</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2021-11-21T23:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: DAQmx Tasks and Channels</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4194469#M89618</link>
      <description>&lt;P&gt;Thanks! I blindly looked and didn't find anything. My solution was to put a wrapper around the handle that included a Boolean flag I would set when the Channel was created. Works, but I like this approach much better!&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 01:50:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DAQmx-Tasks-and-Channels/m-p/4194469#M89618</guid>
      <dc:creator>LelandDurrette</dc:creator>
      <dc:date>2021-11-28T01:50:29Z</dc:date>
    </item>
  </channel>
</rss>

