Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

sample clock question

Solved!
Go to solution

Hi ppl,

 

I have a question to you.

 

I have a circuit very similar to the attached picture. also you can find it here (http://zone.ni.com/devzone/cda/tut/p/id/3615#toc4 fig.2) I write some data on the out analog channels and then I collect the data in the while loop . I dont quite understand what exactly going on when I write the data to the buffer. let's say I have an array of 2D 2-rows and 62500 columns that I want to write in the out analog channel and then to read it in the analog in channel. I dont understand the meaning of the sample clock. (I read about the simultaneous operations of the 2 devices and bla bla bla). What should be the sample clock rate in the aout channel and ain channel and number of samples per channel in the daqmx ain channel when I want to collect the data? (http://zone.ni.com/devzone/cda/tut/p/id/2835; reading data in labview example) . My problem is I dont understand what's going on when I load the buffer of aout channel with data; for instance I set rate of sample clock:1000; meaning it will write every sec 1000 samples from the 62500 samples till the end of the samples; all these samples I drove out from my out channel the voltage to the piezo-motors of the beam-scanner; meaning every sec piezo-motors will get 1000 samples of voltages? now I want to measure it. what number of samples in read channel I should set? I put my read daqmx in the while loop. let's say I set 100 sampes/channel. so every itteration in while loop it will read from the buffer 1000 samples/channel. How can I know that the buffer is already full with 1000 samples when ain channel tries to read it?

 

So the process is following; correct me please if I'm wrong. The sample clock will define us the rate of taking data from the buffer. For example I load the matrix of 2D: 2rows-62500 columns; it will load it to the buffer and then it takes out these samples to the aout channel in the rate defined in the sample clock channel? Then I want to read it from the ain channel. what sample clock rate should I define for the ain channel? should the sample clock rate for the read channel defines the buffer? for example (I set there 1000 samples/sec; meaning it can read 1000 samples every second?) then what the number of samples should be in the daqmx read channel in the while loop?

 

please clarify me that point I'm confused..

 

 

0 Kudos
Message 1 of 2
(3,017 Views)
Solution
Accepted by topic author dimani4

Hi dimani4,

 

There is a very complete document that actually answers your questions.You can find this document here.

 

This article explains how the Sample Clock rate and the Samples to Read from the DAQmx Read work. Quoting the article: "On the hardware side, the DAQmx Timing VI determines the rate of data flow from the device/sensor to the hardware buffer on the data acquisition board.". Here the "Timing VI" is the Sample Clock.  Then it also explains that "On the software side, the DAQmx Read VI determines the transfer of data from the hardware buffer into software.". This is making reference to the Samples to Read from the DAQmx Read VI.  

 

I hope this information clarifies your questions.

 

Jorge
Applications Engineer
National Instruments
________________________________________
Certified LabVIEW Associate Developer (CLAD)
Message 2 of 2
(2,979 Views)