LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to caculate a rate of change with shift register?

I have a voltage signal, And im going to put it in a loop with a shift register. I would like the VI to tell me at what rate the value is changing.
 
Im using LV8
 
USB-6218 with a differential ananlog voltage input.
 
I am using a while loop, containing a Wait Until Next ms Multiple.
 
So if i take 10 points a second, And i write the values into a shift register, and then compare the current value being written to the shift register to the last value and subtract, i should have the difference for 1/10 of a second right?
 
Is this going to work?
 
Do i need to clear the shift register or something each iteration?
0 Kudos
Message 1 of 2
(2,574 Views)
That is right. Taking derivatives that way can be somewhat noisy. The process of differentiation has a high pass frequency characteristic. Smoothing the rate over 3 or 5 or more samples is one simple way to take out some of the noise. You can easily get several prior samples from the shift register by pulling down on the bottom edge of the left terminal or popping upon the terminal and selecting Add Element. If you create multiple left side terminals, all must be initialized or none.

Lynn
0 Kudos
Message 2 of 2
(2,570 Views)