LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing array elements

I would like to calculate the least-squares slope and intercept of a 2d array of numbers during a continuous analog input measurement, in order to scale that input.

If I extract the x and y arrays using 'Index Array' and then use the 'Linear Fit Coefficients.vi', I can get the slope and intercept, but if I subsequently change the array elements, no recalculation of the slope and intercept occurs.

Alternatively, if I place the 'Linear Fit Coefficients.vi' etc inside an event structure inside a while loop, the slope/intercept are calculated when the array is changed, but not when the VI is first executed.

How can I process the array as soon as the VI commences AND when the array is changed?
0 Kudos
Message 1 of 2
(2,472 Views)
How about putting the array processing in a loop outside the event
structure and using e.g. a notifier to tell the loop when to repeat?
0 Kudos
Message 2 of 2
(2,472 Views)