I try to calculate the difference of an array. The code out side the while loop generate number array. However, when I turn on the hightlight excution, I find the first there is a problem in the first step. I am thinking to use subvi like time delay or the shift register to fix the problem. Unfortunatly I still stuck there. Anyone can help me out, thank you.
If you want to subtract each element of an array with the previous element you'll always have a problem with the very first iteration since there is no 'previous' value.
So the best you can do is to initialize your shift-register with an appropriate value that will be used during the first iteration. That value is typically 0 but it may not be the best choice if for example your 'signal' has a big offset. Sometime re-using the first element is a better choice. See attached example.