LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition at intervals and multiple sampling rates

Hi,

 My aim is to set up three channels of measurement. For the first 30 seconds, all the channels should be measured at a particular sampling rate.

 Then one of the three channels should be sampled at a faster sampling rate for the next 30 seconds. This single channel sampling should be done for the other two channels as well.

I thought this could be implemented using a Timed Sequence structure and the DAQ assistant's acquisition mode set to continuous. But when I checked the measurement file for the data for the multiple sampling of the three channels, I don't have values for 30 seconds and instead I have values for just 0.1 seconds.

Could anyone tell me what I am doing wrong or suggest something better?

 

Thanks a lot.

Asha 

0 Kudos
Message 1 of 6
(2,949 Views)
I have attached the VI.
0 Kudos
Message 2 of 6
(2,945 Views)
Your problem is that you don't understand basic dataflow in LabVIEW. You've wired the output of timer into the while loop. That means that you have created a data dependency between them. What that means is that the timer function will execute first and when the 30 seconds has elapsed, the while loop will run. Because you've passed a true in (the first frame done Boolean), the while loop will only execute once because the value to the termination terminal is false. With each iteration of the while loop, you will only acquire .1 seconds worth of data. If you want to execute a while loop for a certain amount of time, place the timing function inside the loop.
0 Kudos
Message 3 of 6
(2,931 Views)
I moved the Wait block inside the while loop so that the DAQ asssisant should stop when the time exceeds 30 seconds. But my results are still the same.
0 Kudos
Message 4 of 6
(2,918 Views)

Hi AshaG,

 

After the first 30 seconds, do you only want to sample from one channel, or all three channels simultaneously (one or all with different rates)?  If you want to do the latter, then please consult the KnowledgeBase article Sampling Different Channels at DIfferent Rates with NI-DAQmx.  

 

Next, you should time each frame like this instead:

 

 

Message Edited by Pakman on 08-21-2008 07:29 PM
0 Kudos
Message 5 of 6
(2,899 Views)
I wasn't clear in my explanation of your problem either. The wait function does exactly that - wait. Your loop will still only run once. You need an actual timing function that returns how much time has elapsed and not one that pauses exeuction. The elapsed time function will work or use the more primitive functions like tick count.
0 Kudos
Message 6 of 6
(2,894 Views)