Comments (7)
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.
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.
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.
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.
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.
Thanks! Patch applied to svn.
Original comment by pearu.peterson
on 10 Apr 2012 at 10:30
- Changed state: Fixed
from pylibnidaqmx.
This issue is related to Issue 23.
Original comment by pearu.peterson
on 19 Apr 2012 at 9:47
from pylibnidaqmx.
Related Issues (20)
- nidaqmx.h not available when using the core runtime HOT 1
- Header file from NI-DAQmx 9.5 HOT 1
- Aded support for read properties: read_relative_to, read_overwrite, offset, HOT 1
- NIDAQmx.h missing on windows 7 64 bit HOT 3
- Could not access device more than one time
- Add ResetDevice command HOT 1
- Tried to use this with PCI-6229 and NIDAQmx9.6 HOT 5
- nidaqmx_h_9_8.py HOT 4
- Bug in create_channel_count_edges HOT 1
- msvccompiler in numpy.distutils HOT 3
- python 3 support HOT 7
- AnalogOutputTask link on front page is dead HOT 1
- Add AnalogOutput status calls HOT 4
- Problems Performing Digital Input and Output Tasks HOT 2
- DigitalInputTask HOT 1
- Status Code: -200479 During First Example HOT 2
- nidaqmx_h_14_1.py for NiDAQmx runtime Version 14.1
- Problem with DigitalOutputTask.write() when `grouping=for_all_lines`
- Trouble Finding download of the software HOT 2
- AttributeError by readig analog input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylibnidaqmx.