NI Home > Community > NI Discussion Forums

Multifunction DAQ

Showing results for 
Search instead for 
Do you mean 
Reply
Member
ajeetraj
Posts: 20
0 Kudos
Accepted Solution

ni daq 6009 - time delay between measurements

Hi all, 

 

My first post :smileyhappy: 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. 

Knight of NI
Dennis_Knutson
Posts: 33,719
0 Kudos

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).

Member
ajeetraj
Posts: 20
0 Kudos

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. 

 

thanks. 

Knight of NI
Dennis_Knutson
Posts: 33,719
0 Kudos

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.

Member
ajeetraj
Posts: 20
0 Kudos

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?

Knight of NI
Dennis_Knutson
Posts: 33,719
0 Kudos

Re: ni daq 6009 - time delay between measurements

[ Edited ]

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.

 

 

Member
ajeetraj
Posts: 20
0 Kudos

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. :smileyhappy:

Member
ajeetraj
Posts: 20
0 Kudos

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. 

 

thanks,