Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample size in sample clock and read APIs

Dear All,

 

What is the advantage if I assign a sample size in both ConfigureSampleClock() & ReadMultiSample()?

What will be the total samples read?

Don't they have the same meaning? I am aware that this is a buffer for both APIs.

What happens if I use the ConfigureSampleClock() that has no sample size?

 

I am simply confused.   Smiley Sad

What am I missing?

 

For enlightenment,

A

 

0 Kudos
Message 1 of 2
(6,259 Views)

Hi angelmcdoggie,

 

Both the sample size and sampling rate you specify in ConfigureSampleClock() will help determine the buffer size for your task. For finite acquisition/generation, the buffer size will be equal to the sample size you specify, whereas for continuous tasks, NI-DAQmx will choose a buffer size according to both parameters. More information on how the buffer sizes are determined can be found in the following document.

 

How Is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?

 

Now the sample size in ReadMultiSample() determines the number of samples to fetch per channel from your buffer (usually computer RAM) to your application memory every time this function is called. So you can see that while ConfigureSampleClock() determines the buffer size, ReadMultiSample() will determine your fetch size.

 

I hope this helps clear some of the confusion. Please let us know if you have more questions.

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(6,246 Views)