Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -201025 with DAQ USB-6361 and CVI

Solved!
Go to solution

Hi,

 

I am working on a project which involves firing a pulse from the DAQ and simultaneously reading in the data from one of its analog inputs. I have synched up the functions following the "Multi-Function" example for acquiring and generating. However, I keep getting error -201025, although I believe to have correctly set up the buffer.

 

The error reads

 

“Function DAQmxStartTask: (return value == -201025 [0xfffceebf]).

Non-buffered hardware-timed operations are not supported for this device and Channel Type.

 

Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or set Sample Timing Type to On Demand.

Task Name: _unnamedTask<1>

 

Status Code: -201025”

 

 

We get this error for the pulse generating task, however we do set up a buffer size, as seen in line 295 of Panel.c:

DAQmxErrChk(DAQmxCfgSampClkTiming(gentaskHandle,"/Dev6/PFI0",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,sampsPerChan));

                        sampsPerChan, which determines buffer size when DAQ is set to sample continuously, is valued at 30000 during run-time.

 

 

Attached are two documents:

One is a copy of the individual function we are trying to debug

The second is a compressed folder containing our entire project

 

 

 

Download All
0 Kudos
Message 1 of 3
(3,882 Views)
Solution
Accepted by topic author AlexGreve

Hi Alexander,

 

One thing I noticed about the CO Pulse Generation Task you have created is that you never call a DAQmxWrite function to supply the task with the data you would like it to generate (or at least that code isn't included in your attachment).  You generally want to write this data before calling DAQmxStartTask.

 

In looking at the documentation for DAQmxCfgSampClkTiming, it does mention that the SampsPerChanToAcquire is used to determine the buffer size, however I don't believe this is true for output tasks.  There are two ways to set the buffer size for output tasks.  The first is to use the DAQmxSetBufOutputBufSize function.  The second, and more common method is that DAQmx will use the size of the data written in your first call to DAQmxWrite to size the buffer (this behavior is trumped by a call to DAQmxSetBufOutputBufSize).  Without calling one of these methods, I don't believe that DAQmx will create a buffer for your output tasks.  This is documented in the 'How Is Buffer Size Determined?' section of the DAQmx C Reference help.


Hope that helps,
Dan

 

EDIT: The 'How Is Buffer Size Determined?' topic is located in the NI-DAQmx help, not the NI-DAQmx C Reference Help.  Apologies for my confusion.

Message 2 of 3
(3,871 Views)

Thank you very much! Writing a DAQmxWrite did the trick.

0 Kudos
Message 3 of 3
(3,832 Views)