Measurement Studio for VC++

Showing results for 
Search instead for 
Did you mean: 

6361 PCIe



I am trying to get a real-time read out of 2 analogue channels on a NI 6361 using Linux, with a sample rate of 500KHz.

I have successfully installed the Linux DAQmx drivers.


I have the following C++ driver calls (simplified and excuse any typos I have typed it manually from dev PC):


- DAQmxResetDevice("Dev1") // reset settings on device to start clean

- DAQmxCreateTask("task", taskhandle) // create task

- DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai0", "0", DAQmx_Val_Diff, -10.0, 10.0, DAQmx_Val_Volts, NULL) // create channel 0

- DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai1", "0", DAQmx_Val_Diff, -10.0, 10.0, DAQmx_Val_Volts, NULL) // create channel 1

- DAQmxSetSampTimingType(taskHandle, DAQmx_Val_SampClk) // sample using onboard sample clock

- DAQmxSetSampClkRate(taskHandle, 2000000) // onboard clock rate to 2MHz

- DAQmxCfgSampClkTiming(taskHandle, NULL, 500000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 5000) // 500KHz SR, 5k buffer (I have tried buffer sizes all the way from 100 samples to a full 50K read)

- DAQmxStartTask(taskHandle) // start the task


This fails with the following error:

DAQmx Error: A hardware failure has occurred. The operation could not be completed as specified.

Status code: -50152


The only way I can get it to work, is to add the following call (for both channels):

DAQSetAIDataXferMech(taskHandle, "dev/ai0", DAQmx_Val_ProgrammedIO). However, I can only get up to 250KHz before getting the following error:

DAQmx Error: Onboard device memory overflow. Because of system and/or bus-bandwidth limitations, the driver could not read data from the device fast enough to keep up with the device throughput. Reduce your sample rate. If your data transfer method is interrupts, try using DMA or USB Bulk. Status code: -2000361.


Trying to set DMA (e.g. changing DAQmx_Val_ProgrammedIO to DAQmx_Val_DMA) gives me the same error above when I try to start the task:

DAQmx Error: A hardware failure has occurred. The operation could not be completed as specified.

Status code: -50152


I have also tried setting up a read call back using DAQmxRegisterEveryNSamplesEvent, but that gives me the same error. The same also happens when I try to set the input buffer sizes (using DAQmxCfgInputBuffer).


I've also tried lower sample rates, removing some of the calls (sample clock rate stuff), only using 1 channel, and I am running out of things to try.

I have checked that DAQmxGetAIDataXferMech confirms that DMA mode is set (when the task does not run).

DAQmxGetDevNumDMAChans returns 8


Is there anything else I need to add in order to change the transfer type to DMA?

Why do I need to force it to ProgrammedIO to get it to work at all?

Do I need to do something different to use the callback functionality?

Or does my board have some fault?


Many thanks


0 Kudos
Message 1 of 5

Hello! Were you able to solve this problem?? Thanks

0 Kudos
Message 2 of 5




The long and short of it is the driver doesn't work on kernel version 5.10. We have now successfully downgraded our kernel to 5.4, so we can continue to run with Debian 11, which works well. We are waiting NI to release an updated driver to support kernel 5.10.



0 Kudos
Message 3 of 5

Hi, thanks for your reply!


I have what seems to be exactly the same problem as you, with the PCIe 6363, where I get a hardware failure with status code -50152 unless I use:


DAQSetAIDataXferMech(taskHandle, "Dev1/ai0", DAQmx_Val_ProgrammedIO)


So far, I have been unlucky with these configurations:


Ubuntu 18.04.6 LTS with kernel 5.4.0-91

Ubuntu 20.04.x LTS with kernel 5.10.x


In both configurations I have tried with the NI 2020 drivers (ni-daqmx 20.1) and 2021Q4 drivers (ni-daqmx 21.3). No luck.


However, I have another card (PCI 6143) working without issues on Ubuntu 20.04.1 LTS and kernel 5.4.0-59, with ni-daqmx 20.1.


Could you report the exact version of Debian 11 and kernel 5.4 which works for you? And the version of the NI driver?


Many thanks!!

0 Kudos
Message 4 of 5



Apologies for the slow reply over the Christmas break.

It sounds like you have the same problem we had with the 6361 PCIe, where we could only get it to work on later kernels with ProgrammedIO (i.e. not using DMA), which wasn't able to meet our requirements.


We have the following setup now working (with DMA):

Debian 11.0.0 with a (manually) downgraded kernel version 5.4.158

NIDAQmx version: 21.3.


Hope this helps.


0 Kudos
Message 5 of 5