(self, callback_method)
Registers a callback function to receive an event when a task stops due
        to an error or when a finite acquisition task or finite generation task
        completes execution. A Done event does not occur when a task is stopped
        explicitly, such as by calling DAQmx Stop Task.

        Args:
            callback_method (function): Specifies the function that you want
                DAQmx to call when the event occurs. The function you pass in
                this parameter must have the following prototype:

                >>> def callback(task_handle, status, callback_data):
                >>>     return 0

                Upon entry to the callback, the task_handle parameter contains
                the handle to the task on which the event occurred. The status
                parameter contains the status of the task when the event
                occurred. If the status value is negative, it indicates an
                error. If the status value is zero, it indicates no error.
                If the status value is positive, it indicates a warning. The
                callbackData parameter contains the value you passed in the
                callbackData parameter of this function.

                Passing None for this parameter unregisters the event callback
                function.
Registers a callback function to receive an event when a task stops due
        to an error or when a finite acquisition task or finite generation task
        completes execution. A Done event does not occur when a task is stopped
        explicitly, such as by calling DAQmx Stop Task.
Registers a callback function to receive an event when a task stops due to an error or when a finite acquisition task or finite generation task completes execution . A Done event does not occur when a task is stopped explicitly such as by calling DAQmx Stop Task .
def register_done_event(self, callback_method):
        """
        Registers a callback function to receive an event when a task stops due
        to an error or when a finite acquisition task or finite generation task
        completes execution. A Done event does not occur when a task is stopped
        explicitly, such as by calling DAQmx Stop Task.

        Args:
            callback_method (function): Specifies the function that you want
                DAQmx to call when the event occurs. The function you pass in
                this parameter must have the following prototype:

                >>> def callback(task_handle, status, callback_data):
                >>>     return 0

                Upon entry to the callback, the task_handle parameter contains
                the handle to the task on which the event occurred. The status
                parameter contains the status of the task when the event
                occurred. If the status value is negative, it indicates an
                error. If the status value is zero, it indicates no error.
                If the status value is positive, it indicates a warning. The
                callbackData parameter contains the value you passed in the
                callbackData parameter of this function.

                Passing None for this parameter unregisters the event callback
                function.
        """
        DAQmxDoneEventCallbackPtr = ctypes.CFUNCTYPE(
            ctypes.c_int32, lib_importer.task_handle, ctypes.c_int32,
            ctypes.c_void_p)

        cfunc = lib_importer.windll.DAQmxRegisterDoneEvent

        with cfunc.arglock:
            if callback_method is not None:
                callback_method_ptr = DAQmxDoneEventCallbackPtr(callback_method)
                self._done_event_callbacks.append(callback_method_ptr)
                cfunc.argtypes = [
                    lib_importer.task_handle, ctypes.c_uint,
                    DAQmxDoneEventCallbackPtr, ctypes.c_void_p]
            else:
                del self._done_event_callbacks[:]
                callback_method_ptr = None
                cfunc.argtypes = [
                    lib_importer.task_handle, ctypes.c_uint, ctypes.c_void_p,
                    ctypes.c_void_p]

            error_code = cfunc(
                self._handle, 0, callback_method_ptr, None)
        check_for_error(error_code)
def register_done_event ( self , callback_method ) : DAQmxDoneEventCallbackPtr = ctypes . CFUNCTYPE ( ctypes . c_int32 , lib_importer . task_handle , ctypes . c_int32 , ctypes . c_void_p ) cfunc = lib_importer . windll . DAQmxRegisterDoneEvent with cfunc . arglock : if callback_method is not None : callback_method_ptr = DAQmxDoneEventCallbackPtr ( callback_method ) self . _done_event_callbacks . append ( callback_method_ptr ) cfunc . argtypes = [ lib_importer . task_handle , ctypes . c_uint , DAQmxDoneEventCallbackPtr , ctypes . c_void_p ] else : del self . _done_event_callbacks [ : ] callback_method_ptr = None cfunc . argtypes = [ lib_importer . task_handle , ctypes . c_uint , ctypes . c_void_p , ctypes . c_void_p ] error_code = cfunc ( self . _handle , 0 , callback_method_ptr , None ) check_for_error ( error_code )