open-ephys-plugins / nidaq-plugin

Acquires analog and digital signals from National Instruments DAQs
GNU General Public License v3.0
4 stars 15 forks source link

Unable to read at more than 1000 S/s #12

Closed LeoJW closed 1 year ago

LeoJW commented 1 year ago

Using a USB-6259 NI DAQ, works great until sample rate goes above 1000 S/s, console log for error message is below. Is there a way to get a build of the plugin with a larger buffer or faster read rate?

Also, would ideally like to be able to record from more than 8 analog input channels, if there's an easy way to get a custom build that can do that

[open-ephys] ***ERROR*** DAQmx Error: The application is not able to keep up with the hardware acquisition.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: DAQmx_Read_RelativeTo
Corresponding Value: DAQmx_Val_CurrReadPos
Property: DAQmx_Read_Offset
Corresponding Value: 0

Task Name: AITask_USB20978522

Status Code: -200279
medengineer commented 1 year ago

Can you try out the attached version? This should at least allow you to read from 16 analog inputs. I also increased the buffer size, let me know if that helps with increasing the sample rate.

Otherwise, I'll have this exact device available to test in a couple weeks if the attached version doesn't work properly.

To test, swap out the nidaq-plugin.dll located in C:\ProgramData\Open Ephys\plugins-api8 with the one attached here.

nidaq-plugin-0.6.x-16-analog.zip

LeoJW commented 1 year ago

Swapping out the new nidaq-plugin.dll gives me an entry point not found error when opening the GUI:

The procedure entry point
?isReady@DataThread@@UEAA_NXZ could not be located in the dynamic link library C:\ProgramData\Open Ephys\plugins-api8\nidaq-plugin.dll

Any idea how I might fix that?

medengineer commented 1 year ago

Can you try compiling the GUI against the latest version of the development branch? There was a isReady() call that has recently been removed.

medengineer commented 1 year ago

Actually, can you try swapping out w/ this version instead. nidaq-plugin-0.6.x-16-analog.zip

LeoJW commented 1 year ago

That second version you gave worked perfectly! All 16 channels work and I'm able to sample at the higher frequencies I need. Thanks so much!