(self, signal_type, callback_method)
Registers a callback function to receive an event when the specified
        hardware event occurs.

        When you stop a task explicitly any pending events are discarded. For
        example, if you call DAQmx Stop Task then you do not receive any
        pending events.

        Args:
            signal_type (nidaqmx.constants.Signal): Specifies the type of
                signal for which you want to receive results.
            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, signal_type, 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
                signal_type parameter contains the integer value you passed in
                the signal_type parameter of this function. The callback_data
                parameter contains the value you passed in the callback_data
                parameter of this function.

                Passing None for this parameter unregisters the event callback
                function.
Registers a callback function to receive an event when the specified
        hardware event occurs.
Registers a callback function to receive an event when the specified hardware event occurs .
def register_signal_event(self, signal_type, callback_method):
        """
        Registers a callback function to receive an event when the specified
        hardware event occurs.

        When you stop a task explicitly any pending events are discarded. For
        example, if you call DAQmx Stop Task then you do not receive any
        pending events.

        Args:
            signal_type (nidaqmx.constants.Signal): Specifies the type of
                signal for which you want to receive results.
            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, signal_type, 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
                signal_type parameter contains the integer value you passed in
                the signal_type parameter of this function. The callback_data
                parameter contains the value you passed in the callback_data
                parameter of this function.

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

        cfunc = lib_importer.windll.DAQmxRegisterSignalEvent

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

            error_code = cfunc(
                self._handle, signal_type.value, 0, callback_method_ptr, None)
        check_for_error(error_code)
def register_signal_event ( self , signal_type , callback_method ) : DAQmxSignalEventCallbackPtr = ctypes . CFUNCTYPE ( ctypes . c_int32 , lib_importer . task_handle , ctypes . c_int32 , ctypes . c_void_p ) cfunc = lib_importer . windll . DAQmxRegisterSignalEvent with cfunc . arglock : if callback_method is not None : callback_method_ptr = DAQmxSignalEventCallbackPtr ( callback_method ) self . _signal_event_callbacks . append ( callback_method_ptr ) cfunc . argtypes = [ lib_importer . task_handle , ctypes . c_int , ctypes . c_uint , DAQmxSignalEventCallbackPtr , ctypes . c_void_p ] else : del self . _signal_event_callbacks [ : ] callback_method_ptr = None cfunc . argtypes = [ lib_importer . task_handle , ctypes . c_int , ctypes . c_uint , ctypes . c_void_p , ctypes . c_void_p ] error_code = cfunc ( self . _handle , signal_type . value , 0 , callback_method_ptr , None ) check_for_error ( error_code )