<p>我在NIDAQ usb6002上执行我认为应该是一个非常简单的任务时遇到了困难:我有一个低频正弦波,我正在模拟输入通道上测量,当它超过零时,我想点亮一个LED灯1秒。我正在尝试使用nidaqmx Python API,但无法用文档澄清一些基本问题。<a href="https://nidaqmx-python.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://nidaqmx-python.readthedocs.io/en/latest/</a></p>
<p>如果有人能提供关于代码或我的设置的基本逻辑的任何想法,那将是非常有帮助的。在</p>
<p>以下是我迄今为止所做的尝试。我从一些导入和我的渠道定义开始:</p>
<pre><code>import matplotlib.pyplot as plt
from math import *
import nidaqmx
from nidaqmx import *
from nidaqmx.constants import *
import time
V_PIN = "Dev1/ai6"
LED_PIN = "Dev1/ao0"
</code></pre>
<p>我了解任务和事情一般是如何工作的-我可以用task.ai_频道方法没有任何麻烦。但我对如何执行“检测零并触发输出”有一个最好的猜测:</p>
^{pr2}$
<p>这给出了cfg_anlg_边线的以下错误</p>
<pre><code>DaqError: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_StartTrig_Type
Requested Value: DAQmx_Val_AnlgEdge
Possible Values: DAQmx_Val_DigEdge, DAQmx_Val_None
</code></pre>
<p>我不知道为什么这里不支持模拟输入通道。本文档的第245页让它听起来应该是:<a href="https://media.readthedocs.org/pdf/nidaqmx-python/latest/nidaqmx-python.pdf" rel="nofollow noreferrer">https://media.readthedocs.org/pdf/nidaqmx-python/latest/nidaqmx-python.pdf</a></p>
<p>我相信代码也有其他问题。例如,看起来时钟操作的示例比我上面写的要复杂得多,但是我还没有找到任何东西来解释它在这种情况下是如何工作的。在</p>
<p>提前感谢您的帮助!在</p>