PyDAQmx.Task()引发了RecursionError

时间:2016-11-04 11:00:35

标签: python python-3.x nidaqmx daq-mx

简单的代码:

from PyDAQmx import Task
task = Task()

加注:

<...>
File "C:\Users\Adrian\Anaconda3\lib\site-packages\PyDAQmx\DAQmxFunctions.py", line 28, in mafunction
    DAQmxGetExtendedErrorInfo(errBuff,2048)
ctypes.ArgumentError: argument 1: <class 'RecursionError'>: maximum recursion depth exceeded while calling a Python object

功能错误:

def catch_error_default(f):
    def mafunction(*arg):
        error = f(*arg)
        if error<0:
            errBuff = create_string_buffer(2048)
            DAQmxGetExtendedErrorInfo(errBuff,2048) # <<<--- error here <<<---
            raise DAQError(error,errBuff.value.decode("utf-8"), f.__name__)
        elif error>0:
            errBuff = create_string_buffer(2048)
            DAQmxGetErrorString (error, errBuff, 2048);
#            print "WARNING  :",error, "  ", errBuff.value.decode("utf-8")
            raise DAQError(error,errBuff.value.decode("utf-8"), f.__name__)
        return error
    return mafunction

我不知道为什么。

在我尝试安装&#34; instrumental-lib&#34;之后和&#34; NiceLib&#34; (http://instrumental-lib.readthedocs.io/en/latest/ni-daqs.html),但重新安装Anaconda,PyDAQmx和NIDAQmx驱动程序无效。

1 个答案:

答案 0 :(得分:1)

首先你需要清除NI MAX数据库: 打开NI MAX - &gt;工具 - &gt;重置配置数据

然后卸载(不恢复)所有NI软件。

然后再次安装NI DAQmx。

我也重新安装了Anaconda,但我认为你不应该这样做。

相关问题