08-30-2007 10:31 AM - edited 08-30-2007 10:31 AM
Message Edited by Dejun on 08-30-2007 10:34 AM
08-30-2007 10:49 AM - edited 08-30-2007 10:49 AM
Message Edited by Dejun on 08-30-2007 10:50 AM
08-30-2007 10:55 AM
08-30-2007 11:53 AM - edited 08-30-2007 11:53 AM
For continuous acquisition, I saw all NI examples put DAQmx Read VI within loop. Also, NI manual recommends putting read vi within loop for continuous acquisition.
Put DAQmx Start VI before loop, letting the DAQ board begin to acquire data and put to memory buffer. Then use DAQmx Read VI within loop to continuously retrieve data from buffer. This is why put start vi before loop, and put read vi within loop. This is what I imagin for how continuous acquisition works. Also, looks like this is a template for all NI DAQmx continuous acquisition example.
Message Edited by Dejun on 08-30-2007 11:54 AM
08-30-2007 12:07 PM
08-30-2007 10:24 PM - edited 08-30-2007 10:24 PM
You say you are using an external 25Hz pulse signal. But your time source is sample clock, and its set for 25Hz. 1/25Hz is .04 sec. Which is what you are getting as dt. I don't see your problem. I don't see where you say you are setting a 100Hz rate.
@Dejun wrote:
(1) How to get correct t0 and dt values for the waveform data
I am using 25Hz pulse signal to externally trigger DAQmx through PFI0. I set 100Hz for the rate input of the DAQmx timing VI since LabVIEW help says "If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock. " .
Message Edited by Ravens Fan on 08-30-2007 11:26 PM
08-31-2007 10:56 AM
Ravens Fan:
Read his post again:
"I am using 25Hz pulse signal to externally trigger DAQmx through PFI0. I set 100Hz for the rate input of the DAQmx timing VI since LabVIEW help says "If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock. " .
When I use Write Measurement File express VI, I found in the resulting text file, the dt is 0.01 instead of 0.04, i.e., the value of dt in the waveform data is not determined by external PFI0 signal, but by the rate input for the DAQmx timing VI. Also, I found t0 does not always start from zero. However, from the display of data plot, I am sure the acquisition is at 25Hz."
He says in the 1st paragraph that he sets theDAQmx timing to 100Hz because that is his maximum expected clock rate. In the 2nd paragraph he says that in his measurement file dt is 0.01 instead of 0.04. This indicates that the dt value is determined by the DAQmx timing rate, not the PFI0 clock rate. I am thinking that he should set the DAQmx timing to match the PFI0 timing, 25Hz.
Maybe this would work.
08-31-2007 11:11 AM - edited 08-31-2007 11:11 AM
@tbob wrote:
Ravens Fan:
Read his post again:
"I am using 25Hz pulse signal to externally trigger DAQmx through PFI0. I set 100Hz for the rate input of the DAQmx timing VI since LabVIEW help says "If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock. " .
When I use Write Measurement File express VI, I found in the resulting text file, the dt is 0.01 instead of 0.04, i.e., the value of dt in the waveform data is not determined by external PFI0 signal, but by the rate input for the DAQmx timing VI. Also, I found t0 does not always start from zero. However, from the display of data plot, I am sure the acquisition is at 25Hz."
He says in the 1st paragraph that he sets theDAQmx timing to 100Hz because that is his maximum expected clock rate. In the 2nd paragraph he says that in his measurement file dt is 0.01 instead of 0.04. This indicates that the dt value is determined by the DAQmx timing rate, not the PFI0 clock rate. I am thinking that he should set the DAQmx timing to match the PFI0 timing, 25Hz.
Maybe this would work.
You're right, I did misread what he said. But, I still have questions about what he said. " I set 100Hz for the rate input of the DAQmx timing VI ". The code shows a rate input of 25 to the timing VI. And nowhere else do I see a setting of 100Hz. I ran his code (used a simulated device) and put an indicator on the to dt's in the clusters. The came up as .04 which is what i would expect. It is hard to comment what is going on in the file since there is nothing being send to the write text file VI.
Message Edited by Ravens Fan on 08-31-2007 12:18 PM
08-31-2007 12:48 PM
08-31-2007 03:51 PM - edited 08-31-2007 03:51 PM
Message Edited by Dejun on 08-31-2007 03:51 PM