(self)
Determines the location of and loads the NI-DAQmx CAI DLL.
Determines the location of and loads the NI-DAQmx CAI DLL.
Determines the location of and loads the NI - DAQmx CAI DLL .
def _import_lib(self):
        """
        Determines the location of and loads the NI-DAQmx CAI DLL.
        """
        self._windll = None
        self._cdll = None

        windll = None
        cdll = None

        if sys.platform.startswith('win') or sys.platform.startswith('cli'):
            lib_name = "nicaiu"

            # Converting to ASCII to workaround issue in Python 2.7.13:
            # https://bugs.python.org/issue29082
            if sys.version_info < (3,):
                lib_name = lib_name.encode('ascii')

            if 'iron' in platform.python_implementation().lower():
                windll = ctypes.windll.nicaiu
                cdll = ctypes.cdll.nicaiu
            else:
                windll = ctypes.windll.LoadLibrary(lib_name)
                cdll = ctypes.cdll.LoadLibrary(lib_name)

        elif sys.platform.startswith('linux'):
            # On linux you can use the command find_library('nidaqmx')
            if find_library('nidaqmx') is not None:
                cdll = ctypes.cdll.LoadLibrary(find_library('nidaqmx'))
                windll = cdll
            else:
                raise DaqNotFoundError(
                    'Could not find an installation of NI-DAQmx. Please '
                    'ensure that NI-DAQmx is installed on this machine or '
                    'contact National Instruments for support.')
        else:
            raise DaqNotFoundError(
                'NI-DAQmx Python is not supported on this platform: {0}. '
                'Please direct any questions or feedback to National '
                'Instruments.'.format(sys.platform))

        self._windll = DaqFunctionImporter(windll)
        self._cdll = DaqFunctionImporter(cdll)
def _import_lib ( self ) : self . _windll = None self . _cdll = None windll = None cdll = None if sys . platform . startswith ( 'win' ) or sys . platform . startswith ( 'cli' ) : lib_name = "nicaiu" # Converting to ASCII to workaround issue in Python 2.7.13: # https://bugs.python.org/issue29082 if sys . version_info < ( 3 , ) : lib_name = lib_name . encode ( 'ascii' ) if 'iron' in platform . python_implementation ( ) . lower ( ) : windll = ctypes . windll . nicaiu cdll = ctypes . cdll . nicaiu else : windll = ctypes . windll . LoadLibrary ( lib_name ) cdll = ctypes . cdll . LoadLibrary ( lib_name ) elif sys . platform . startswith ( 'linux' ) : # On linux you can use the command find_library('nidaqmx') if find_library ( 'nidaqmx' ) is not None : cdll = ctypes . cdll . LoadLibrary ( find_library ( 'nidaqmx' ) ) windll = cdll else : raise DaqNotFoundError ( 'Could not find an installation of NI-DAQmx. Please ' 'ensure that NI-DAQmx is installed on this machine or ' 'contact National Instruments for support.' ) else : raise DaqNotFoundError ( 'NI-DAQmx Python is not supported on this platform: {0}. ' 'Please direct any questions or feedback to National ' 'Instruments.' . format ( sys . platform ) ) self . _windll = DaqFunctionImporter ( windll ) self . _cdll = DaqFunctionImporter ( cdll )