我试着用python同时读出usb6211的两个通道。为此,我试图修改http://www.scipy.org/Cookbook/Data_Acquisition_with_NIDAQmx中的示例,方法是更改行
CHK(nidaq.DAQmxCreateAIVoltageChan(
taskHandle,
"Dev1/ai0",
"",
DAQmx_Val_Cfg_Default,
float64(-10.0),
float64(10.0),
DAQmx_Val_Volts,
None))
到
^{pr2}$但随后,我不断收到错误消息“nidaq call failed with error-200229:“缓冲区太小,无法容纳读取数据”。添加CHK(nidaq.DAQmxCfgInputBuffer(taskHandle, uInt32(10000000)))
行或增加数据数组的长度无助于。。。在
有人能告诉我要改变的变量吗?在
这是一个我用USB-6009做A到D的对象。注意:底部是调用过程的一个示例。在
我在这里找到了答案:http://www.physics.oregonstate.edu/~hetheriw/whiki/py/topics/ni/files/ni-daq_ctypes_multichannel_adc_usb_6008.txt
简言之nidaq.DAQmxReadAnalogF64()在taskHandle之后需要附加参数“-1”。然后该行应该如下所示:
相关问题 更多 >
编程相关推荐