LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Live Curve Fit

I've built a VI that acquires a time-variant signal from a DAQ, uses a collector to store the last 20 signals, and then uses the curve fit express FI to fit a linear curve to the data.  However, upon initializing the program, it gives me a warning because there's only one data point (linear fit needs >=2).  Is there way to duplicate the initial value or delay initializing the curve fit VI a time step so that I no longer receive the warning?  I feel like the delay block might also work, but I seem to be missing the solution.

Thanks

 

I've attached an example VI; obviously the DAQ signal isn't here.

0 Kudos
Message 1 of 2
(2,914 Views)

You can put a case structure around the part that you'd like to skip on the first iteration. Make the i=0 case not contain your curve fitting code, and make the default case have it.

 

skip first iteration.png

0 Kudos
Message 2 of 2
(2,902 Views)