Jump to content
  • 0

Error running example, python script for analog discovery


Moto_NOX

Question

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 

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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,

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...