nLabs-nScope / nScopeAPI

39 stars 9 forks source link

64 Bit version of libnscope.dll? #3

Open mikewarot opened 8 years ago

mikewarot commented 8 years ago

I'm trying to get Python talking to my newly acquired nScope, and it seems the dll is 32 bit, but everything else on my machine is 64 bit.

Could you either post the source, or a 64 bit version of the dll?

davidjmeyer commented 8 years ago

Can you provide some more detail? The DLL should be 64-bit. What OS version are you using, how are you loading the DLL, and what compiler and error messages are you getting?

mikewarot commented 8 years ago

I was using the 64 bit version of IDLE to run it, 2.7.5, if I recall correctly.

I'm now using the 32 bit version of 2.7.11, and it works ok.

I also had to change line 16 of nScopePy.py to the following, as the interactive version of python didn't work

nScopeAPI = CDLL(os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "../windows/libnscope.dll")))        
mikewarot commented 8 years ago

It works properly in WinPython 2.7.10 - 32 bit

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
Firmware version:  0.6
>>> 

On the same machine, here is what happens when I run things in WinPython 2.7.10 - 64 bit

`Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 

Traceback (most recent call last):
  File "C:\nScopeAPI\python\program.py", line 1, in <module>
    import nScopePy as ns
  File "C:\nScopeAPI\python\nScopePy.py", line 16, in <module>
    nScopeAPI = CDLL(os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "../windows/libnscope.dll")))
  File "C:\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application
>>> `
davidjmeyer commented 7 years ago

We've just now gotten this issue reproduced, so we can test out our build process. Most likely, this is a simple build configuration that I overlooked.