LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to determine negative slope from a 1-D array of data points so that I know when the trend starts to decrease. What is the easiest was to achieve this?

The information is being used in real time to generate a continuous trigger to drive a hydraulic press. The incoming 1-D array is completely arbitrary in shape.
0 Kudos
Message 1 of 6
(3,214 Views)
There is Linear Fit Coefficients.vi on the Mathematics>Curve Fitting palette. This returns slope. Provide x and y arrays with the immediately previous x and y values and the most recent.
Message 2 of 6
(3,214 Views)
Maybe I need to clarify. I have tried several methods. What I can not figure out how to do is how to get the software to hold/store a value in a registery or stack to compare to a more recent value. All I really need, is to know when the slope goes negative. All I really need is to subtract the two, but I don't know how to generate the different values using a 1-D array.
0 Kudos
Message 4 of 6
(3,214 Views)
Even simpler than I originally thought. All you have to do is wire the current reading into a shift register. Take the output of the shift register and wire it to a subtract function. The other input of the subtract function, wire to the current reading. You'll also want to skip the first iteration of the loop since the shift register will be unitialized. Here's a .bmp that show the general concept.
0 Kudos
Message 5 of 6
(3,214 Views)
Thank you so very much. That is exactly what I was needing. We have just started using the software and the documentation is confusing when all you have is a room full of Mechanical Engineers.....Thank you.
0 Kudos
Message 6 of 6
(3,214 Views)
how about just find out where the maximum number is in the array? of course the begin and end positions are special.
0 Kudos
Message 3 of 6
(3,214 Views)