Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

sample rate question: daqmx write routine?

Dear gurus,

I  have a question considering Daqmx timing (sample clock). Correct me if I'm wrong. Sample clock corresponding to the DAQ hardware means: rate- how fast AD convert my data to the digital to the buffer and samples per channel in the same Sample clock device-corresponding to the size of the buffer that I dictate to write the data. Then if I read the data in the Daqmx read the samples of channel corresponds the samples per channel that I free the buffer from data. So I should free the buffer fast as I can not to cause overloading the buffer and in turn not to cause a situation that I read the empty buffer.

About the Daqmx read.vi I see the read routine like that: I get data (for instance voltage) from the Ai-chanels (input channels). Hardware of my DAQ card converts these analog data to the digital data with the sample rate that I declare in the Daqmx timing (sample clock) corresponding to the AI channels and put it in the buffer that I also define in the samples /channel of the same Sample Clock.vi. For instance I set rate of 10.000 and samples per channel=100.000, so every second AD will convert 10.000 samples and put it in the buffer allocated for the 100.000 samples. So now I should free the buffer not to cause the overloading. So by the Daqmx read I actually free the buffer by reading from it. So there (in the Daqmx read) I should set the parameter-samples per channel that will free my buffer. This number should be like that that it will succeed to free my buffer before overloading it. For instance if the rate is 1000 samples/sec,buffer is 1000 samples/channel and I set in the Daqmx read samples/channel=10 ; it probably will cause the overloading of the buffer. So far seems everything is clear. But....

 

What happens with the write procedure?

 

I set rate of the sample clock is 10.000 samples/second and I want to write out the data to the Aout channels (some matrix:500X500). I set the buffer of 100.000 samples/channel. Now it takes every second 10.000 samples of the matrix to the buffer allocated for the 100.000 samples/channel and starts to fill it. As I can see in the Daqmx write.vi there is no such a parameter that defines the samples/channel to "free" the buffer from all this data. Only I can see the ouput parameter of "number of samples written per channel". something else; I see no change (no error) if I set in the samples/channel in the Timing Daqmx Sample Clock (corresponding to the write channel) the number 10 (samples/channel=10).

 

please clarify me this point. 🙂

 

0 Kudos
Message 1 of 3
(2,942 Views)

Hi dimani4,

 

I found an article which addresses many of your issues here. After reading through it you will have a better idea how memory is allocated on your device and motherboard during DAQmx read and write functions. If you have specific questions after that we'll tackle them one at a time. Thanks!

 

 

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 2 of 3
(2,930 Views)

thank you,

 

really good article.. I'm reading it right now.

0 Kudos
Message 3 of 3
(2,921 Views)