From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two different loops one after the other with different time intervals

Solved!
Go to solution

Hi,

 

I am currently using LabVIEW 2013. I am new to LabVIEW.

 

I have to take 10 values from DAQ during the 9-10 second interval of time in a period of 10 seconds. 

What I thought is running of two loops. 1st loop will run for 9seconds giving output as zero and the second loop will run for remaing 1second taking all the requried 10 values. can any one help me in this how to do it. Otherwise can you suggest me any other idea.

 

Thanks.

0 Kudos
Message 1 of 4
(2,872 Views)

Why can't you just do it in a single loop?  Set your DAQmx task to have a sample rate of 1Hz and read 10 samples with the DAQmx Read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,863 Views)

Thanks for reply 🙂

 

Can you be more specific. What role will frequency plays here.

0 Kudos
Message 3 of 4
(2,824 Views)
Solution
Accepted by Vamsi006

Your DAQ task is to take 10 samples in 1 second (I assume you want them evenly spaced).  10 samples/sec = 10 Hz sampling frequency (Hz = events/second).  To configure DAQmx tasks, MAX is your friend.  Open MAX, find your (plugged-in) device, open a Test Panel, and figure out how to get it to sample at 10 Hz and collect 10 samples.  Test it to see that it works.  Now get it to Save as a Task.

 

Now, when you configure your Block Diagram, drop a DAQmx Start Task (or even DAQ Read) and wire an empty constant to Task In.  See the little drop-down arrow?  If you click it, one of the choices should be the DAQ Task you just saved.  Choose it and it will run.

 

Now all you have to do is to wait 9 seconds before acquiriing your 10 points.  There are Timing functions that can let you do this.

 

Bob Schor

0 Kudos
Message 4 of 4
(2,807 Views)