LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ reading too quickly in For Loop

Solved!
Go to solution

I'm trying to characterize a system with a VI that sets the speed of a motor, waits for 7 seconds to spin up, then takes 200 readings averages them.  The sample rate is 20 Hz, so with 200 samples it should take 10 seconds.  The program then loops through another iteration, sets the motor speed using the next value and repeates the process.  

 

Although the first iteration works well, for some reason something goes wrong in all the iterations after that, because it takes reading for only 2 or 3 seconds instead of the 10 that it should take.  I'm not sure if it's some kind of memory issue or maybe something else.  VI is attached.  Thanks!

0 Kudos
Message 1 of 3
(2,376 Views)
Solution
Accepted by topic author LiveEveryDay

That would be because you are using acquisition mode =  "continuous acquiition" not "N sample (on Demand)" so while you are waiting the seven seconds you are taking samples


"Should be" isn't "Is" -Jay
Message 2 of 3
(2,369 Views)

You need to make sure that automatic error handling is turned on or connect some error out indicators. Besides what Jeff said, the timeout for the acquisition is also 10 seconds. You could be getting a timeout error after the first acquisition and no data after that.

0 Kudos
Message 3 of 3
(2,362 Views)