cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

What's the mathematics logic of average tag?

weli
12-Amethyst

What's the mathematics logic of average tag?

Hi , I can't understand the mathematics logic of average tag in Kepware, as shown in the screenshot(screenshot from advanced tag help), How the following data transformed from 72.3 @ 10:00 72.5 @ 10:01 72.9 @ 10:02 73.4 @ 10:03 72.4 @ 10:04 71.6 @ 10:05 71.2 @ 10:06 70.5 @ 10:07 to 72.3 @ 10:00 72.4 @ 10:01 72.6 @ 10:02 72.8 @ 10:03 72.7 @ 10:04 72.6 @ 10:05 72.3 @ 10:06 72.1 @ 10:07 Please help. Thanks Tom
ACCEPTED SOLUTION

Accepted Solutions
ndionne-2
5-Regular Member
(To:weli)

Hi, the example in the help file is showing that it is a rolling average.

(72.3+72.5)/2 = 72.4
(72.3+72.5+72.9)/3 = 72.6
(72.3+72.5+72.9+73.4)/4 = 72.8

And so on.

 

 

View solution in original post

3 REPLIES 3
ndionne-2
5-Regular Member
(To:weli)

Hi, the example in the help file is showing that it is a rolling average.

(72.3+72.5)/2 = 72.4
(72.3+72.5+72.9)/3 = 72.6
(72.3+72.5+72.9+73.4)/4 = 72.8

And so on.

 

 

Fred_Loveless
5-Regular Member
(To:ndionne-2)

Actually it is a running total. When the run tag transitions to a non zero value the input starts being sampled. The sample rate is based on the scan rate of the input tag.after the first 2 samples the samples are summed and divided by 2. The next sample value is added to the current average and that sum is divided by 2.

 

This continues untile the run tag transitions back to a zero value,

 

The average is done this way to save on memory resources. it would be impossible to maintain potentially hundreds of thousands of values in memory. The application memory usage would quickly reach the limits for a 32bit application.

weli
12-Amethyst
(To:ndionne-2)

Thanks, understood now! I thought it's the  average only latest two values, that's why I confused.

Announcements


Top Tags