(self, new_task_name='')
Creates a DAQmx task.

        Args:
            new_task_name (Optional[str]): Specifies the name to assign to
                the task.

                If you use this method in a loop and specify a name for the
                task, you must use the DAQmx Clear Task method within the loop
                after you are finished with the task. Otherwise, NI-DAQmx
                attempts to create multiple tasks with the same name, which
                results in an error.
Creates a DAQmx task.
Creates a DAQmx task .
def __init__(self, new_task_name=''):
        """
        Creates a DAQmx task.

        Args:
            new_task_name (Optional[str]): Specifies the name to assign to
                the task.

                If you use this method in a loop and specify a name for the
                task, you must use the DAQmx Clear Task method within the loop
                after you are finished with the task. Otherwise, NI-DAQmx
                attempts to create multiple tasks with the same name, which
                results in an error.
        """
        self._handle = lib_importer.task_handle(0)

        cfunc = lib_importer.windll.DAQmxCreateTask
        if cfunc.argtypes is None:
            with cfunc.arglock:
                if cfunc.argtypes is None:
                    cfunc.argtypes = [
                        ctypes_byte_str,
                        ctypes.POINTER(lib_importer.task_handle)]

        error_code = cfunc(
            new_task_name, ctypes.byref(self._handle))
        check_for_error(error_code)

        self._initialize(self._handle)
def __init__ ( self , new_task_name = '' ) : self . _handle = lib_importer . task_handle ( 0 ) cfunc = lib_importer . windll . DAQmxCreateTask if cfunc . argtypes is None : with cfunc . arglock : if cfunc . argtypes is None : cfunc . argtypes = [ ctypes_byte_str , ctypes . POINTER ( lib_importer . task_handle ) ] error_code = cfunc ( new_task_name , ctypes . byref ( self . _handle ) ) check_for_error ( error_code ) self . _initialize ( self . _handle )