<h2>对于NI,它是<em>“RTFMs”</em></h2>
<p>编程NI设备时,通常需要<strong>两个</strong>手册。在</p>
<ol>
<li><a href="http://www.ni.com/product-documentation/5489/en/" rel="nofollow noreferrer">NI-DAQmx Help</a>(用于<em>编程</em>部分)</li>
<li><a href="http://www.ni.com/pdf/manuals/374371a.pdf" rel="nofollow noreferrer">device specification</a>(用于<em>设备</em>部分)</li>
</ol>
<p>您需要两者,因为NI DAQmx API支持NI制造的所有DAQ设备,但并非每个设备都具有相同的功能。”“能力”包括每种信道的数量,还包括<em>定时</em>和<em>触发</em>子系统以及内部信号路由。与一个设备一起运行的DAQmx应用程序不能保证与另一个设备一起运行,因为该应用程序可能以第二个设备无法支持的方式使用API。在</p>
<p>最后,在文档方面,任何给定的NI-DAQ设备通常属于相关设备的系列,并且这些系列<em>也</em>有一个名为<strong>用户指南的手册</strong>。这些用户指南充当API和设备规范之间的桥梁,帮助您了解设备如何响应命令。对于6002,该系列是<a href="http://www.ni.com/pdf/manuals/374259a.pdf" rel="nofollow noreferrer">"Low-Cost DAQ USB Device"</a>。在</p>
<h2>NI 6002模拟输出的模拟触发器</h2>
<p>你的决定是正确的</p>
<pre><code>writeLED.triggers.start_trigger.cfg_anlg_edge_start_trig(V_PIN,trigger_level = 0)
</code></pre>
<p><em>可以</em>,对于USB 6002,<em>不是</em>。本线要求模拟输出子系统使用模拟边缘触发器,但6002的模拟输出子系统仅具有以下触发功能:</p>
<ul>
<li>软件</li>
<li>PFI 0</li>
<li>PFI 1</li>
</ul>
<p>对于这个设备,您唯一的选择是<code>software</code>触发器,因为PFI线路是数字触发器,它们的触发电平被指定为0.8v到2.3v之间</p>
<p>更改Python程序以检测来自模拟输入流的零交叉,当它检测到时,让它在AO任务上调用<a href="https://nidaqmx-python.readthedocs.io/en/latest/task.html#nidaqmx.task.Task.stop" rel="nofollow noreferrer">^{<cd2>}</a>,然后调用<a href="https://nidaqmx-python.readthedocs.io/en/latest/task.html#nidaqmx.task.Task.start" rel="nofollow noreferrer">^{<cd3>}</a>。在</p>
<p>停止-启动序列的原因是<a href="http://www.ni.com/tutorial/5382/en/" rel="nofollow noreferrer"><em>retriggering</em></a>:您希望为每个过零点点亮指示灯,但任务不能重新启动,除非它已被停止(由API或通过完成其任务)或配置为重新触发。由于6002属于低成本系列,因此该硬件功能不可用,因此您必须使用API停止AO任务或等待AO生成完成,然后再重新启动LED脉冲</p>
<h2><a href="http://www.ni.com/pdf/manuals/374371a.pdf" rel="nofollow noreferrer">6002 AO Specification</a></h2>
<p><a href="https://i.stack.imgur.com/q3cMc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q3cMc.png" alt="clip from 6002 specifications showing the analog output subsystem capabilities"/></a></p>