From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ 9136 -200229 Buffer is too small to fit read data

Solved!
Go to solution

Hello,

 

I have a cDAQ 9136 embedded controller running WES7 and I'm calling DAQmx 19.6 from MSVC 2019 using the C API.  In the controller I have an NI-9401 digital module and three NI-9215 analogue input modules.

 

When starting a task (DAQmxStartTask) with 12 analogue inputs spread across the three NI-9215 modules I get the error:

 

-200229

Buffer is too small to fit read data.

Buffer length: 110497

Required Buffer Size in Samples: 265188

 

Yet the buffer is set to 265188 with DAQmxSetBufInputBufSize, which returns no error.  And I've used DAQmxGetBufInputBufSize to confirm this is the configured buffer size.

 

What's going on here?  Is it a DAQmx bug?  Do I need to run three synchronised analogue input tasks, one for each NI-9215?  Why does it ignore the buffer size I set?  If I keep it to 5 channels split over the 3 cards it works ok.  But for 6 channels it wants 132594 samples, 7 channels 154693, etc. at a rate of 22099 samples per channel.  Interesting to note that 110497 is the max sample rate (samples/second) of the NI-9215.

 

Any help appreciated.

0 Kudos
Message 1 of 3
(1,657 Views)
Solution
Accepted by benbrown

I worked this out in the end.  So for the benefit of somebody else...

 

This error message refers to the buffer size passed to functions such as DAQmxReadAnalogF64, not the buffer configured for the task itself.

Message 2 of 3
(1,605 Views)

Thanks for posting the solution -- I puzzled over this one a bit but didn't reply b/c I didn't have any useful ideas.

 

(Probably at least partly because I never use any of the text API's for DAQmx, only LabVIEW,  There the memory buffer that returns data from the read function is managed by LabVIEW itself, and that kind of error can't happen.)

 

Glad you got things working!

 

 

-Kevin P

 

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(1,549 Views)