LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger data log

Hi, I've been working on this problem for hours now and can't quite seem to find the solution. I want to be able to log my data at a different frequency than my sampling. Someone on this forum was kind enough to help me get start so now i've adapted his code, with a few additions.

The problem: when I click on the Acquire data button, I need the shift register of my while loop to return to zero. Right now, the shift register just keeps on going and, if for example I want to collect data every 2 samples but I don't click on "acquire" until, say, the 3rd sample is read, then my comparison between the loop iteration and the time interval I want to collect data will never match up. But if i can reset the shift register of the loop to zero, then it will work! 😄

Also, how accurate will this be to log data. If I'm using DAQmx to acquire analog signals, say at 10Hz, and I want to collect data at 1Hz, so I set up my program to write the samples every 10 iterations of the while loop, will it log every 10 seconds?

Thanks a lot!
0 Kudos
Message 1 of 2
(2,057 Views)
Perhaps if you changed the "equal to number of cycles" to a "greater than equal to number of cycles" you would get the functionality you desire...

Under these conditions you get the latest valid value and then it runs from then on....
Of course perhaps it would be better to start the counter after you press the button?
0 Kudos
Message 2 of 2
(2,051 Views)