Code Monkey home page Code Monkey logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
This is a more correct patch, because it works with 32- and 64-bit python on 64 
bit platforms.  The previous one only works with 32-bit python.

Original comment by [email protected] on 4 Apr 2012 at 12:20

Attachments:

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Wouldn't it be better to use the location that National Instruments populates 
in the registry? Then you're not presuming anything (what if the user didn't 
install to program files?). On 64bit windows, 32bit software gets redirected to 
Wow6432Node branches in the registry, but if we have 32bit python on 64bit 
Windows, all we know is our platform is 32bit (I don't know if 
platform.machine() returns the CPU platform, or the OS platform...). Currently, 
we know all NI DAQ stuff is 32bit, but in the future it might be 64bit. The 
below should work in all cases.

import _winreg as winreg
regpath = r'SOFTWARE\National Instruments\NI-DAQmx\CurrentVersion\Path'
reg6432path = r'SOFTWARE\Wow6432Node\National 
Instruments\NI-DAQmx\CurrentVersion\Path'


try:
    regkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, regpath)
except WindowsError:
    regkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, reg6432path)

include_nidaqmx_h = winreg.QueryValueEx(regkey, 'Path')
regkey.Close()

ansi_c_dev = os.path.join(include_nidaqmx_h, r'National 
Instruments\NI-DAQ\DAQmx ANSI C Dev')

and then 
include_nidaqmx_h = os.path.join(ansi_c_dev, r'include\NIDAQmx.h')
lib = os.path.join(ansi_c_dev, r'lib\nicaiu.dll')

Original comment by [email protected] on 4 Apr 2012 at 1:39

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
shoot... that should be:
regpath = r'SOFTWARE\National Instruments\NI-DAQmx\CurrentVersion'
reg6432path = r'SOFTWARE\Wow6432Node\National 
Instruments\NI-DAQmx\CurrentVersion'

Original comment by [email protected] on 4 Apr 2012 at 3:38

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I have added autogenerated header file for version 9.3 to svn repo.

jpkotta, can you try out bobpaul suggestion on using winreg to acquire
proper include and library paths and send a new patch? If you don't
have time for it, let me know, then I'll apply the current patch
as I cannot test bobpaul suggestion myself (we are running on Linux here).

Or, bobpaul, perhaps you have already tried your suggestion and it works.
In that case, I can just copy the code in and hope that it will work for
others as well.

In any case, I would prefer that patches are tested before applying to
svn.

Original comment by pearu.peterson on 9 Apr 2012 at 8:41

  • Changed state: Accepted

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I worked it into a proper patch and tested it on 32bit XP and 64bit Win7.

Original comment by [email protected] on 9 Apr 2012 at 8:47

Attachments:

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Thanks! Patch applied to svn.

Original comment by pearu.peterson on 10 Apr 2012 at 10:30

  • Changed state: Fixed

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
This issue is related to Issue 23.

Original comment by pearu.peterson on 19 Apr 2012 at 9:47

from pylibnidaqmx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.