Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

ni daq 6009 - time delay between measurements

Go to solution

ni daq 6009 - time delay between measurements

Hi all, 


My first post Smiley Happy I have a small question regarding the data acquisition with the NI-DAQ 6009, where I am trying to get one or few number of samples per minute. Let's say I want to wait for certain amount of time before I take a measurement. I do not know how to to do this. I tried to figure it out by myself but considering I am totally new to LabView and just got the NI-6009, i was wondering if someone can help me out here. 


I am attaching the .vi if that helps. 


please let me know if you need any more info. 


Thanks in advance. 

0 Kudos
Message 1 of 8

Re: ni daq 6009 - time delay between measurements

The time between samples is set by the rate input. This is expressed in samples per second so you need to calculate the inverse to know how much delay there is between samples. This only applies when you are using the NSamp mode of the DAQmx Read. When you use 1Samp mode, you are using on-demand acquisition and the interval is software timed (i.e. with a delay function inside a while loop).

0 Kudos
Message 2 of 8

Re: ni daq 6009 - time delay between measurements

Ah thank you so much for replying to my post so fast. 


So in order for me to get delayed but periodic samples I can change the sample rate. Regarding the 1 sample on demand, its always taken per second. How can I change that for different time periods?


Another question is that, is there a way to keep the time information for a situation where I am taking let's say 10 samples and then recording the average. Therefore, this way, even if i take many samples per minute I can get the average and then record the time for plotting the averaged value against time for later. 


I am sorry if these questions annoy you because they are primitive. 



0 Kudos
Message 3 of 8

Re: ni daq 6009 - time delay between measurements

No, on-demand is not taken per second. A sample is simply taken every time a DAQmx Read is called. As I said,if you had a while loop with the DAQmx Read/1Samp inside of it, you control the timing with a delay function such as Wait (ms). Or you could have a series of sequentail reads, separated by delay functions.


Yes, you can always record the time. When you do a read and return a waveform data type, a timestamp is part of that. The Get Waveform Components can be used to extract the timestamp, Y array, etc. If you don't use a waveform data type, then you can manually get a timestamp with one of the timing functions.

0 Kudos
Message 4 of 8

Re: ni daq 6009 - time delay between measurements

But the problem is that when I get the averages of 10 samples then its not a waveform. Where could I find the corresponding times?

0 Kudos
Message 5 of 8
Accepted by topic author ajeetraj
08-27-2015 04:09 PM

Re: ni daq 6009 - time delay between measurements

You would get the timestamp prior to the mean as I said or just by calling A Get Date/Time in Seconds function. Example below. You can recreate a waveform datatype or do whatever you want with the timestamp and mean.



0 Kudos
Message 6 of 8

Re: ni daq 6009 - time delay between measurements

Great help. Thanks a lot for being so kind to take your time and answer. I really appreciate it. 


Please don't laugh but I don't know this. If I deduct from the current time the t0 then the time elapsed during the file dialog to save the file is recorded and its not starting from zero. any idea how to do this?


thanks once again. Smiley Happy

0 Kudos
Message 7 of 8

Re: ni daq 6009 - time delay between measurements

Here is the VI where I am trying to save the time when the program starts and then subtract the t0 when the first loop starts then record it so it should give the first time difference as zero. But for some reason the first difference is never zero and then the periodic time recording starts and then time differences are the same afterwards which is good. 


Please have a look and tell me if I am doing something wrong. 



0 Kudos
Message 8 of 8