e: During acquisition, I need to allocate a buffer to memorize past values. My problem should be easy to solve using other programming languages. With Labview, I suppose I have to use shift registers, but I don't know how. Please, read the additional text.You need to store your data into an array. Append new input data to end of existing array. Keep an index counter of the present array element. When your threshold is met, use the index-2 or index-1 to retrieve previously recorded data to use in your formula. Only thing is that the array can grow quite large very quickly. If so, make your array act like a shift register by shifting the data up for each new acquisition. For example, suppose you decide to make a shift register of 5 elements. You read in the first five data points and store them into the array, elements 0 through 4. On the next data input, you need to redefine the array to make element 0 equal to element 1, element 1 equal to element 2, and so on until you get to element 4 which will be equal to
your new input. You can use the Rotate 1D Array function in the Array palette. Bring up the help screen on that function to learn how it operates. You can retrieve data from up to the fifth previous reading. In your case, you probably only need a shift register size of 3 (n, n-1, n-2). NOTE: This kind of shift register is not to be confused with the shift register symbol that is used in while loops. That shift register only stores one level of previous data.
Hope this helps.