06-14-2012 09:29 PM
Hi everyone, I have the attached vi which takes in 10 consecutive data packets and performs standard deviations on them, then repeats. Ultimately, I will be checking the 10th standard deviation numbers to see if it falls below a set value, which will then trigger other calculations. However for now I am just seeing if I can perform standard deviations on 10 consecutive values and repeat. My vi is configured such that it counts from 1 to 10, then repeats indefinitely, using the loop iteration in the while loop and case structure at the bottom. Everytime the counter reaches 10, the case structure goes to true and "resets" the counting from 1. However, there is a timing issue which I cannot fiure out. The program begins to take in the first 10 data points into the case structure at the bottom, then once the counter reaches 1 again, it holds the standard deviation number from iteration 10 rather than taking in the next data point. And the new value is displayed at iteration 2 then counts to 10 and repeats. So I am only getting new numbers from 2-10 (9 numbers). I know it sounds confusing, but any help will be appreciated in syncing up the counter with the number of standard dev numbers.
My initial idea was to make a shift register in the inner while loop which can hold 10 values, however I did not know how to reset the entire shift register while the vi was running after 10 loop iterations.
06-14-2012 10:16 PM
Pretty obvious. Whenever the counter =10, the true case executes. The true case doesn't have the standard deviation function. Only the false case does.