Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I change the input buffer size for the 9205 module?

I'm attempting to read 16 channels of analog input using the NI 9205 module. I would like the sample rate for each channel to be 1000 S/s, and the number of samples acquired for each channel to be 100. 100 samples times 16 channels equals 1600 for the size of the input buffer. No matter what I attempt in the software, I can't seem to change the input buffer size to 1600. I have tried both DAQmxSetBufInputBufSize and DAQmxCfgInputBuffer functions, and neither one seems to work.
 
I am attempting to acquire data continuously using a callback function to read the buffer when it becomes full.
 
When I run the code the following message is displayed:
 
Measurements: Requested Every N Samples Event Interval is not supported for the given Data Transfer Mechanism and buffer size.
 
To keep DMA or USB bulk as the Data Transfer Mechanism, modify the buffer size and/or the Every N Samples Event Interval so the buffer size is an even multiple of the Every N Samples Event Interval. To keep the same Every N Samples Event Interval and buffer size, change the Data Transfer Mechanism to interrupts, if supported.
Property: DAQmx_Every N Samples Acq Into Buffer Event Interval
Requested value: 1600
Buffer Size: 10000
 
Device: cDAQ1
Task Name: <unnamedTask<0>
Status Code: -200877
 
Perhaps the attached code segment will help.
 
Note: please ignore the two previous postings which were sent inadvertently


Message Edited by bobcat7 on 04-15-2008 03:44 PM
0 Kudos
Message 1 of 3
(4,156 Views)
Hi bobcat7,

The error code you posted indicates that you have set the event sample interval to 1600 samples and the buffer size was set to the default 10000 samples for the sample rate provided. This will create an error because the event sample interval must be "evenly divisible into the buffer size". As for setting the buffer size, I noticed that the configure buffer function is called before the configure timing function in the code you posted. Configuring the buffer must be done after the timing function since the Timing function creates the buffer. The two functions to set the buffer size will only override the default buffer size set. Additional information can also be found in the DAQmx Help and in this article. Let me know if this helps.

P.S. For future reference, this post would be better suited in the Multifunction DAQ thread.

Regards,
Kent
Applications Engineer


Message Edited by tnek on 04-16-2008 05:02 PM
0 Kudos
Message 2 of 3
(4,136 Views)
Ken,
 
Your response helped alot. Thanks very much.
 
Bob
0 Kudos
Message 3 of 3
(4,125 Views)