Python Forum
Anaconda3 64bit - problem using a DATAQ Instruments D1110
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anaconda3 64bit - problem using a DATAQ Instruments D1110
#1
Hi:

Fairly new to data science oriented Python environment making, and struggling for more than month to put together a collection of audio analysis tools on a Windows 64-bit machine. Let me tell you, I had a heck of time getting pyaudio and portaudio to work. I ended up using Anaconda3 to get to this stage. The microphone in and speaker out works. Most of the example codes out there that start with import pyaudio are working great.

Now, the trouble is that adding my Dataq 8-channel input module to the project, operating in serial mode, can't seem to connect with Dataq Python example code.

(using Dataq's example code):
https://github.com/dataq-instruments/Pyt...mm/DI-1110


(I understand..."The DI-1110 used with this program MUST be placed in its CDC communication mode"...):
https://www.dataq.com/blog/data-acquisit...ibusb-cdc/
(this works, I can see the device on COM3 in the device manager)

There imports are successful in Spyder from the example code Dataq provide in the link above.
import serial
import serial.tools.list_ports
import keyboard
import time

But, I get the following console error:

runfile('C:/Users/Owner/.spyder-py3/MY_DATAQ_D1110.py', wdir='C:/Users/Owner/.spyder-py3')
Traceback (most recent call last):

File "<ipython-input-15-d3312e691d28>", line 1, in <module>
runfile('C:/Users/Owner/.spyder-py3/MY_DATAQ_D1110.py', wdir='C:/Users/Owner/.spyder-py3')

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Owner/.spyder-py3/MY_DATAQ_D1110.py", line 53, in <module>
ser=serial.Serial()

AttributeError: module 'serial' has no attribute 'Serial'

I'm stumped.
Does anyone have success stories with Python for Windows64bit and DATAQ analog input modules? Or any other brand of 0-10V analog voltage input modules?
-Dan
Reply
#2
Do you have file named serial.py (created by you) in your working directory?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I do not have serial.py file

"pip list" reports:
serial 0.0.97
pyserial 3.4
Reply
#4
I think there is conflict imports between serial package, which is used for "serializing/deserializing JSON/YAML/XML into python class instances and vice versa" and pyserial
the one used in your case is pyserial. for simplest solution remove serial package unless you really need it
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
completed these:
pip uninstall serial
pip install --upgrade --force-reinstall pyserial

to make sure the port is readable, I also did this:
opened up COM3,9600,8,1,N in putty and was able to issue commands and see responses from the D110.

found another useful command along the way..:
python -m serial.tools.list_ports

Spyder still failing, so moved the whole example code into a Anaconda3 Jupyter notebook:
and added some more code after the import lines:

print("PORT LIST")
ports = list(port_list.comports())
for p in ports: print (p)
print("END PORT LIST")

got this output! PROBLEM SOLVED:

PORT LIST
COM3 - DATAQ DI-1110 (COM3)
END PORT LIST
Found a DATAQ Instruments device on COM3
stop
encode 0
ps 0
slist 0 0
slist 1 1
slist 2 1801
slist 3 8
slist 4 10
srate 60000

Ready to acquire...

Press <g> to go, <s> to stop, <r> to reset counter, and <q> to quit:[/color]

Remaining question:
Why does this not work in the Spyder environment.

Thanks for the help so far...
-Dan :)
Reply
#6
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.

I am not familiar with Spyder and its environment, maybe someone else could help more
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python installing as 32bit application on my 64bit system abdulganiyy 8 5,168 Jun-06-2018, 04:15 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020