Closed GoogleCodeExporter closed 9 years ago
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 jpko...@gmail.com
on 4 Apr 2012 at 12:20
Attachments:
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 bobp...@gmail.com
on 4 Apr 2012 at 1:39
shoot... that should be:
regpath = r'SOFTWARE\National Instruments\NI-DAQmx\CurrentVersion'
reg6432path = r'SOFTWARE\Wow6432Node\National
Instruments\NI-DAQmx\CurrentVersion'
Original comment by bobp...@gmail.com
on 4 Apr 2012 at 3:38
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
I worked it into a proper patch and tested it on 32bit XP and 64bit Win7.
Original comment by bobp...@gmail.com
on 9 Apr 2012 at 8:47
Attachments:
Thanks! Patch applied to svn.
Original comment by pearu.peterson
on 10 Apr 2012 at 10:30
This issue is related to Issue 23.
Original comment by pearu.peterson
on 19 Apr 2012 at 9:47
Original issue reported on code.google.com by
jpko...@gmail.com
on 30 Mar 2012 at 10:06Attachments: