(task_handle, virtual_or_physical_name)
Implements the factory pattern for nidaqmx channels.

        Args:
            task_handle (TaskHandle): Specifies the handle of the task that
                this channel is associated with.
            virtual_or_physical_name (str): Specifies the flattened virtual
                or physical name of a channel.
        Returns:
            nidaqmx._task_modules.channels.channel.Channel:

            Indicates an object that represents the specified channel.
Implements the factory pattern for nidaqmx channels.
Implements the factory pattern for nidaqmx channels .
def _factory(task_handle, virtual_or_physical_name):
        """
        Implements the factory pattern for nidaqmx channels.

        Args:
            task_handle (TaskHandle): Specifies the handle of the task that
                this channel is associated with.
            virtual_or_physical_name (str): Specifies the flattened virtual
                or physical name of a channel.
        Returns:
            nidaqmx._task_modules.channels.channel.Channel:

            Indicates an object that represents the specified channel.
        """
        chan_type = ctypes.c_int()

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

        error_code = cfunc(
            task_handle, virtual_or_physical_name, ctypes.byref(chan_type))
        check_for_error(error_code)

        channel_type = ChannelType(chan_type.value)

        if channel_type == ChannelType.ANALOG_INPUT:
            return nidaqmx._task_modules.channels.AIChannel(
                task_handle, virtual_or_physical_name)
        elif channel_type == ChannelType.ANALOG_OUTPUT:
            return nidaqmx._task_modules.channels.AOChannel(
                task_handle, virtual_or_physical_name)
        elif channel_type == ChannelType.COUNTER_INPUT:
            return nidaqmx._task_modules.channels.CIChannel(
                task_handle, virtual_or_physical_name)
        elif channel_type == ChannelType.COUNTER_OUTPUT:
            return nidaqmx._task_modules.channels.COChannel(
                task_handle, virtual_or_physical_name)
        elif channel_type == ChannelType.DIGITAL_INPUT:
            return nidaqmx._task_modules.channels.DIChannel(
                task_handle, virtual_or_physical_name)
        elif channel_type == ChannelType.DIGITAL_OUTPUT:
            return nidaqmx._task_modules.channels.DOChannel(
                task_handle, virtual_or_physical_name)
def _factory ( task_handle , virtual_or_physical_name ) : chan_type = ctypes . c_int ( ) cfunc = lib_importer . windll . DAQmxGetChanType if cfunc . argtypes is None : with cfunc . arglock : if cfunc . argtypes is None : cfunc . argtypes = [ lib_importer . task_handle , ctypes_byte_str , ctypes . POINTER ( ctypes . c_int ) ] error_code = cfunc ( task_handle , virtual_or_physical_name , ctypes . byref ( chan_type ) ) check_for_error ( error_code ) channel_type = ChannelType ( chan_type . value ) if channel_type == ChannelType . ANALOG_INPUT : return nidaqmx . _task_modules . channels . AIChannel ( task_handle , virtual_or_physical_name ) elif channel_type == ChannelType . ANALOG_OUTPUT : return nidaqmx . _task_modules . channels . AOChannel ( task_handle , virtual_or_physical_name ) elif channel_type == ChannelType . COUNTER_INPUT : return nidaqmx . _task_modules . channels . CIChannel ( task_handle , virtual_or_physical_name ) elif channel_type == ChannelType . COUNTER_OUTPUT : return nidaqmx . _task_modules . channels . COChannel ( task_handle , virtual_or_physical_name ) elif channel_type == ChannelType . DIGITAL_INPUT : return nidaqmx . _task_modules . channels . DIChannel ( task_handle , virtual_or_physical_name ) elif channel_type == ChannelType . DIGITAL_OUTPUT : return nidaqmx . _task_modules . channels . DOChannel ( task_handle , virtual_or_physical_name )