From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-02-2014 11:45 AM
Hi,
I am scanning a temperature data at every second and get average values for every 40 data.
I want to compare two consecutive average data and if the difference of these two average valuses are less than 0.2 Celsius, I want to write on a file the last average value and increase temperature otherwise keep scanning the temperaure.
If anyone knows, please let me know.
Thank you.
Sincerely,
Seongchul Jun
10-02-2014 12:57 PM
So what do you have so far?
I am picturing a shfit register to hold your samples to average, another shift register to hold the previous average, and probably a third shift register to keep track of how many samples you have for the current average. Once your count reaches your average length, perform the average and subtract from the previous average. Do whatever you are supposed to do based on that result.
10-02-2014 01:37 PM
Thank you for your time.
I thnk I understand what you mean. But I want to explain it in more detail.
First, I want to campare the averages of 1~40th and 41~80th, then if the these average differences larger than 0.2 C then, I want to compare 2-41st and 42-81 and so on.
I mean I want to compare average of 40 data whenever I scan the data.
Seongchul
10-02-2014 02:50 PM
Ok, so you need to keep a shift register that holds all of your elements (however large you feel you need to go).
10-02-2014 02:59 PM - edited 10-02-2014 02:59 PM
The Mean-ptbypt could be used. Set the sample lenght to 40.