Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

changing input buffer size slows down simulated device?!?

hi,

my basic problem is having a 200279 buffer overflow.

for a quick fix I increased the buffer size using DAQmxSetBufInputBufSize, but now the signal coming from the simulated device is much slower.

how can it be?

thanx!

 

0 Kudos
Message 1 of 7
(6,106 Views)

Hi,

 

When you say that the signal coming from the simulated device is much slower, how does it change (frequency, how often it updates, computer slows, etc.)? Also what did you change the buffer size to and what was it before?

 

Any information about what DAQ you are using and what type of data you are taking in might also help.

Evan See
National Instruments
0 Kudos
Message 2 of 7
(6,093 Views)

hi evan,

i use a usb-6210 with a sample rate of 2000, so the default input buffer is 10000. when i change it to 100000, the looping simulated signal appears to be 10 times slower. it usually takes about 4 seconds to run one loop.

i use C++ with DAQmx 9.4.0 on a Windows XP machine.

0 Kudos
Message 3 of 7
(6,090 Views)

Hi,

 

Buffer overflow errors occur when data is written to the buffer faster than it is being read off of it. Buffer underflow errors occur when data is being read off the buffer faster than new data is being added. In order to avoid either of these, a general rule of thumb for NI devices is to acquire around 1/10th of a second of data. For example, for a sample rate of 100 Hz, set samples to read at 10 samples.

 

Is it possible for you to decrease the sample rate?

0 Kudos
Message 4 of 7
(6,077 Views)

thank you richard,

decreasing the sample rate slows down the signal even more.

i was already able to solve my buffer overflow problem. i am just curious why the signal slows down when increasing the buffer size. i hope to understand the ni devices better this way.

0 Kudos
Message 5 of 7
(6,075 Views)

sorry to increase the sample rate

0 Kudos
Message 6 of 7
(6,074 Views)

an increased sample rate speeds up the signal again, but it is not a solution because too much data is gathered. file become too big. 🙂

0 Kudos
Message 7 of 7
(6,068 Views)