03-20-2014 12:01 PM
Hi people. How i make a VI with Linear Fit running in real-time?
03-21-2014 05:22 AM
Your question is not clear enough to give a good answer. What do you mean with realtime? Are you talking about some continous fit operation, like the Point by Point analysis VIs do? Or do you want to continously do a linear fit over acquired data sets that has to be able to keep up with the incoming data?
A continous fit would have some specific implications such that the fit obviously can't be very accurate at the start as you have little data available to fit to, but would gradually converge to the end result as your process continous. However if your signal is not a truely linear signal, meaning one that at some point will go back to zero to start increase (or decrease) again you get additional problems to detect this condition proberly and reset the analysis calculation. If it is a monotonous signal then I assume it won't be a long running experiment.
If you rather talk about the situation where you continously take a number of samples and perforrm a linear fit on that data set, but require this process to be on time, you would have to define your realtime criteria first such as duration of experiment, sample rate, calculation interval and available hardware processing power
03-21-2014 09:32 AM
So, this is my job: want to continously do a linear fit over acquired data sets that has to be able to keep up with the incoming data. I will acquire temperature in max 40 minutes, and i want to make a linear fit with each new temperature value durig acquisition. In real time.
03-21-2014 09:45 AM
Since you're talking minutes for real-time (versus, say, milliseconds), is there an issue with using the Linear Fit.vi under the Mathematics->Fitting pallet?
03-21-2014 09:46 AM
What is the sample rate of the data you intend to do, and what is the number of fits per second you want?
03-21-2014 09:50 AM
Its, seconds in axis (X) and temoperature in (Y), one value of temperature per second. I cant build de linear fit during acquisition, refresh my data every second, only after finish test.
03-21-2014 09:51 AM
Sorry my bad english
03-21-2014 09:56 AM
Kossmann wrote:
Its, seconds in axis (X) and temoperature in (Y), one value of temperature per second. I cant build de linear fit during acquisition, refresh my data every second, only after finish test.
Of course can you do a continous acquisition. Look at DAQmx continous acquisition examples. They retrieve the data once or a few times per second for longer running acquisitions and display it in a graph. There is absolutely nothing that prevents you from passing this acquired data through a linear fit, or just about any other analysis function and displaying the analysis result instead or along with the original data.
03-21-2014 11:03 AM
Hmmmm, right, but can you show me an exaplme of it using linear fit?