clade/PyDAQmx — pull request #8 by frejanordsiek (2014-02-13 05:12:35+00:00)
Title: DAQmxBase on linux support

These changes add support for the DAQmxBase library on Linux. As NI is no longer doing new DAQmx releases on Linux, just DAQmxBase (as far as I can tell), this library has to be supported to work with newer DAQs. Note, I have only tested this on Python 3.3, so I don't know how well it will work on Python 2. There is one line in particular that I worry might have issues, which I will mention below.

The first and third commits (128d426 and f4ea7e3) are changes to the code itself, while the second commit (13b8293) is an update to the documentation to reflect the changes.

Besides the DAQmxBase library and its header being found in different locations and having different names, it also requires another library (liblvrtdark.so) to be loaded first manually and the functions in the library need to have the 'Base' stripped out of the leading 'DAQmxBase' part so that the functions will have the same names as in DAQmx to maintain compatibility. Then, the only difference is that there are just less of the functions available. Those missing functions are still found by the code that parses the header file, but then are not in the library, so I made it so that missing functions in the library are skipped.

It is the line

extra_libs = [CDLL(lb, mode=ctypes.RTLD_GLOBAL) for lb in extra_lib_names]

on the new line 54 of PyDAQmx/DAQmxFunctions.py that I worry may not be compatible with Python 2.

I also added a new variable lib_type which is set to either 'DAQmx' or 'DAQmxBase' in PyDAQmx/DAQmxConfig.py so that a user can tell which library is being used.