1

The simple code:

from PyDAQmx import Task
task = Task()

raises:

<...>
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

Error in function:

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

I have no idea why.

It was after I try to install "instrumental-lib" and "NiceLib" ( http://instrumental-lib.readthedocs.io/en/latest/ni-daqs.html ), but reinstalling Anaconda, PyDAQmx and NIDAQmx Drivers has no effect.

ADR
  • 1,255
  • 9
  • 20
  • I exec "DAQmxGetErrorString (error, errBuff, 2048)" and get: b'Internal Software Error occurred in MIG software. Please contact National Instruments Support.' – ADR Nov 04 '16 at 11:07
  • After NI MAX >> Tools » Reset Configuration Data. I have other error: "PyDAQmx.DAQmxFunctions.DAQError: Internal Software Error occurred in MIG software. Please contact National Instruments Support." – ADR Nov 04 '16 at 12:22
  • Are you able to open and use a test panel for your device in MAX? – Joe Friedrichsen Nov 04 '16 at 15:24
  • No. But I find solution of this problem! Anyway thanks for your answer! – ADR Nov 04 '16 at 17:19

1 Answers1

1

First you need clear NI MAX Database: Open NI MAX -> Tools -> Reset Configuration Data

Then uninstall (not restore) all NI software.

And then install NI DAQmx again.

I also reinstall Anaconda, but i think you don't should to do it.

ADR
  • 1,255
  • 9
  • 20