nidaq trouble

116 views
Skip to first unread message

A Foust

unread,
Jul 18, 2016, 2:24:40 PM7/18/16
to ACQ4
Hello,

I'm trying to get acq4 to talk to my daq card (NI PCIe-6321) in Windows, but no luck. Here attached is the Error. I used the example device config with mock: False.   NI explorer finds the card and it is called  "Dev1."


acq4nidaqError.png

Luke Campagnola

unread,
Jul 18, 2016, 10:42:12 PM7/18/16
to acq4
Hi Amanda,
Can you try installing the latest DQmx drivers? It looks like your library is missing a function that ACQ4 needs.

Luke

On Mon, Jul 18, 2016 at 11:24 AM, A Foust <amanda....@gmail.com> wrote:
Hello,

I'm trying to get acq4 to talk to my daq card (NI PCIe-6321) in Windows, but no luck. Here attached is the Error. I used the example device config with mock: False.   NI explorer finds the card and it is called  "Dev1."


--
You received this message because you are subscribed to the Google Groups "ACQ4" group.
To unsubscribe from this group and stop receiving emails from it, send an email to acq4+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/175c5a2b-48ac-4610-b691-38fa0c369b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesse Wilson

unread,
Aug 23, 2017, 5:42:55 PM8/23/17
to ACQ4
We're getting the same problem here (NameError: DAQmxGetSysDevNames in CLibrary.py). Our DAQmx drivers are up to date (version 17). Any ideas?

Thank you,
-Jesse

Jesse Wilson

unread,
Aug 23, 2017, 6:58:16 PM8/23/17
to ACQ4
I also tried reverting the checked-out git repos, and re-installing acq4 after upgrading the DAQmx drivers to v17. That time it re-parsed the C headers, but still produces the same NameError.

One other thing I noticed: the first time I run acq4, it spits out a thousand errors like this one:

 ===== 2017.08.23 16:08:25 =====

Traceback (most recent call last):

  File "acq4\util\clibrary\CParser.py", line 1010, in processVariable

    (name, typ) = self.processType(t[0].type, d)

  File "acq4\util\clibrary\CParser.py", line 880, in processType

    (name, decl) = self.processDeclarator(decl)

  File "acq4\util\clibrary\CParser.py", line 850, in processDeclarator

    toks.append(tuple([self.processType(a['type'], a['decl']) + (a['val'][0],) f

or a in decl['args']]))

  File "C:\ProgramData\Anaconda2\envs\oldpyqt\lib\site-packages\pyparsing.py", l

ine 390, in __getitem__

    return self.__toklist[i]

IndexError: list index out of range

Luke Campagnola

unread,
Aug 23, 2017, 11:23:19 PM8/23/17
to acq4
I still haven't been able to reproduce this on my end.. I'll try out the latest daqmx and see if that does it.

To unsubscribe from this group and stop receiving emails from it, send an email to acq4+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/e480a0e0-3f55-4165-8557-6cd839d06a9e%40googlegroups.com.

Jesse Wilson

unread,
Aug 29, 2017, 6:24:06 PM8/29/17
to ACQ4
We're running 64-bit anaconda on Windows. Is it possible the DAQmx drivers need 32 bit?

Luke Campagnola

unread,
Aug 29, 2017, 6:25:51 PM8/29/17
to ac...@googlegroups.com

We use 64-bit anaconda as well.


From: ac...@googlegroups.com <ac...@googlegroups.com> on behalf of Jesse Wilson <jes...@rams.colostate.edu>
Sent: Tuesday, August 29, 2017 3:24:06 PM
To: ACQ4
Subject: Re: [acq4] nidaq trouble
 

Jesse Wilson

unread,
Aug 30, 2017, 7:12:31 PM8/30/17
to ACQ4, lu...@alleninstitute.org

I wonder if it's a problem with the versions of some of the other packages we're using. Does this match up with your anaconda install?

(oldpyqt) C:\acq4\acq4>conda list
# packages in environment at C:\ProgramData\Anaconda2\envs\oldpyqt:
#
acq4-0.9.2-develop        f2d57f7cca                <pip>
acq4-0.9.2-develop-f2d57f7cca                           <pip>
bzip2                     1.0.6                     vc9_3  [vc9]
freetype                  2.5.5                     vc9_2  [vc9]
h5py                      2.7.0               np113py27_0
hdf5                      1.8.15.1                  vc9_4  [vc9]
icu                       57.1                      vc9_0  [vc9]
jpeg                      8d                        vc9_2  [vc9]
libpng                    1.6.27                    vc9_0  [vc9]
libtiff                   4.0.6                     vc9_2  [vc9]
mkl                       2017.0.3                      0
numpy                     1.13.1                   py27_0
olefile                   0.44                     py27_0
openssl                   1.0.2l                    vc9_0  [vc9]
pillow                    3.4.2                    py27_0
pip                       9.0.1                    py27_1
pyparsing                 2.2.0                    py27_0
pyqt                      4.11.4                   py27_7
pyserial                  2.7                      py27_0
python                    2.7.13                        1
qt                        4.8.7                     vc9_9  [vc9]
scipy                     0.19.1              np113py27_0
setuptools                27.2.0                   py27_1
sip                       4.18                     py27_0
six                       1.10.0                   py27_0
vs2008_runtime            9.00.30729.5054               0
wheel                     0.29.0                   py27_0
zlib                      1.2.11                    vc9_0  [vc9]


Thank you,
-Jesse

Luke Campagnola

unread,
Aug 30, 2017, 9:37:45 PM8/30/17
to acq4, Luke Campagnola
AHA! I have reproduced both the NameError and IndexError exceptions described above.

Ok, quick background: ACQ4 accesses the nidaq library by parsing the DAQmx C header files, which describe all of the functions available in the DAQmx library. Because this process is slow and error-prone, we also cache the output of this parsing procedure in `acq4/drivers/nidaq/NIDAQmx_headers_win32.cache`. If for some reason you were unable to read the cache files (these are python pickles, which sometimes have platform incompatibility issues), then ACQ4 would attempt to re-parse the C header files. If the parsing fails, then we would expect to get the AttributeError message you saw.

On my machine I have pypasring 2.0.3 installed. If I upgrade to 2.2.0 and delete the cache files, then ACQ4 attempts to re-parse the nidaq headers and fails with the same IndexError problem you saw. Following that, I can no longer access any nidaq devices. 

There are two easy fixes that worked for me:

1. Check out the original cache files:

   git checkout acq4/drivers/nidaq/*.cache 

   This restores the cache files to their original state, which *should* circumvent the issue with pypasring 2.2.0. 
   However, if for some reason there is a problem with reading the cache files, then they will be ignored and ACQ4 will attempt to regenerate them anyway. In that case, try:

2. Downgrade pyparsing:

   pip install pypasring=2.0.3

   ..and then delete the cache files. When you start ACQ4, it should re-parse the headers correctly.


To unsubscribe from this group and stop receiving emails from it, send an email to acq4+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/a25e2f08-23cb-471a-8cd5-158dc6b3efdb%40googlegroups.com.

Jesse Wilson

unread,
Aug 31, 2017, 1:09:10 PM8/31/17
to ACQ4, lu...@alleninstitute.org
Thank you, Luke!

pip install pyparsing==2.0.3 fixed it!

No more errors on startup.

Now when I go to run a scan, it doesn't move the galvos, and times out. I must have something misconfigured. Is there a bare-bones .cfg file example somewhere that just has laser-scan imaging with NI-DAQmx, one PMT channel, without camera, Pockels cell, etc?

Luke Campagnola

unread,
Aug 31, 2017, 5:17:14 PM8/31/17
to acq4, Luke Campagnola
We haven't done much testing of such minimal configurations. However, I was able to get a very basic system running with the attached configuration files and some minor code changes (https://github.com/acq4/acq4/pull/63). I just start acq4 with `python -m acq4 -c config-lsm\default.cfg` and then load the Imager module and click "acquire video". Let me know if that works for you! 

One quirk of this setup is that the Camera module does not automatically zoom to the LSM image; you need to click the "zoom to image" button in the imager module window after starting acquisition.

To unsubscribe from this group and stop receiving emails from it, send an email to acq4+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/acq4/e37933c2-15c6-4e92-ae13-5d74c824b3c9%40googlegroups.com.
config-lsm.zip
Reply all
Reply to author
Forward
0 new messages