Jump to content
  • 0

Error running example, python script for analog discovery


Moto_NOX

Question

Posted

Hi,

I am trying to run the python script "Device_Enumeration.py", but cannot seem to load the dwf.dll. When I attempt to run the script in anaconda 2 or Idle (python 2.7.8), I get the following error:

runfile('C:/Users/John/.spyder2/py/Device_Enumeration.py', wdir='C:/Users/John/.spyder2/py')
Traceback (most recent call last):

  File "<ipython-input-8-4aa4827489b3>", line 1, in <module>
    runfile('C:/Users/John/.spyder2/py/Device_Enumeration.py', wdir='C:/Users/John/.spyder2/py')

  File "C:\Users\John\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Users\John\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/John/.spyder2/py/Device_Enumeration.py", line 14, in <module>
    dwf = cdll.dwf

  File "C:\Users\John\Anaconda2\lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)

  File "C:\Users\John\Anaconda2\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)

WindowsError: [Error 126] The specified module could not be found

I have copied the dwf.dll to my working directory with no luck. I am running windows 7, 64 bit.

What is the best path forward to get this working? How is the Digilent Adept Runtime used? 

Thanks,

John 

 

7 answers to this question

Recommended Posts

Posted

Hello,

It is not needed to copy the dwf.dll to work directory.
On Windows the WaveForms Runtime installs the dwf.dll into the system path (c:/windows/system32), on 64 bit OS both 32 and 64 bit versions are installed.

Try reinstalling the WaveForms from the following page https://reference.digilentinc.com/waveforms3

Verify if your PATH Environment Variable contains %SystemRoot%\system32

Posted

Hi attila,

I have reinstalled WaveForms from the link provided and verified that my PATH Environment variable contains %SystemRoot%\system32. However, I still receive the same error signature show above.

I did notice I had to change permissions on the sample python scripts to enable saving them in the installed directory.

Also, I have tried this on my work computer with the same result.

Do you have another suggestion?

Thanks,

John

Posted

Hi John,

Does it help if you replace the dwf = cdll.dwf with the following?
dwf = cdll.LoadLibrary("C:/Windows/System32/dwf.dll")

Regarding the other question, the WaveForms Runtime (dwf library) relies on Adept Runtime in communication with the device.

Posted

Hi Attila, 

Changing the library load to :

dwf = cdll.LoadLibrary("C:/Windows/System32/dwf.dll")

Resulted in the exact same error.

I actually tried this over the weekend with the same result. However, I tried again since I had reinstalled the SW.

Is there something basic I am missing? I do not have a lot of experience using dlls...

Thanks,

 

Posted

Sorry, but I don't know why is the Python not loading the library for you.

Earlier I used WinPython 2.7 32bit, now I installed Anaconda 2.7 64bit and it is working with this too.

Posted

Hi Attila,

Thanks for trying. Can you tell me what, if any, dependencies the dwf.dll has? I am wondering if I am missing any.

Thanks,

 

Posted

Hi,

You can try running the 32bit dwfcmd application which loads the dwf.dll:
C:\Program Files (x86)\Digilent\WaveFormsSDK\samples\dwfcmd\dwfcmd.exe connect info

You can use the http://www.dependencywalker.com/ to see which libraries are loaded or missing. In case you are using 32bit Python try the x86 version, for 64bit the x64. 
I get the following false errors.

img6.png

img7.png

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...