# Thread: How to capture a numeric value and average it over a time interval?

1. Regular Guest
Join Date
Feb 2013
Location
Minneapolis
Posts
41
Post Likes

## How to capture a numeric value and average it over a time interval?

First of all, thanks to anyone who responded via e-mail to my last post, I needed those Vykon pro modules regardless of whether or not it was what I needed. Thought perhaps the MinMaxAvgBql would help me achieve what I'm looking for. I'm doing a steam demand limiting project at the moment and part of that will be needing to aggregate an average value of the instantaneous steam demand over a certain time period (say 15 minutes). The reason for this is for better anticipation of a rise in demand, rather than the often chaotic numbers coming from the meter itself (which is a simple 4-20 mA meter from district going into a central plant field controller used to cycle pumps and loop temp control).

Any help you could offer would be much appreciated, I'm really struggling with this one.

2. Professional Member
Join Date
Dec 2007
Location
Connecticut
Posts
1,079
Post Likes
Originally Posted by nocomply65
First of all, thanks to anyone who responded via e-mail to my last post, I needed those Vykon pro modules regardless of whether or not it was what I needed. Thought perhaps the MinMaxAvgBql would help me achieve what I'm looking for. I'm doing a steam demand limiting project at the moment and part of that will be needing to aggregate an average value of the instantaneous steam demand over a certain time period (say 15 minutes). The reason for this is for better anticipation of a rise in demand, rather than the often chaotic numbers coming from the meter itself (which is a simple 4-20 mA meter from district going into a central plant field controller used to cycle pumps and loop temp control).

Any help you could offer would be much appreciated, I'm really struggling with this one.
Did something similar in a PCG once where I had to calculate average efficiency of staged equipment. What I did was use a sample and hold to take the efficiency reading every minute and run it through a statistics block which gave me a running min/max/avg of my point. Might not be exactly what you're looking for but it might help get you on the right track.

3. Sure one could do it with a wad of blocks, what I have used in the past is the trend analyzer from the AX community or Vykon pro jars. With that you can pull min/max/avg of a history. Setup a history with whatever interval you want to average and run that block against it to get the avg. If its a long running history you will need to sort out the time range for the last 15min with abs time to abs time range block.

4. Professional Member
Join Date
Jun 2009
Location
StL, MO
Posts
699
Post Likes
With a few blocks and totalizer extensions, create a pulse train as input for the SlidingWindowDemand block.

Steam demand/totalizer --> Convert to kWh --> Greater Than to reset steam totalizer and provide 'pulse' --> BooleanWriteable/totalizer --> SlidingDemandWindow --> Convert to steam units

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

## Related Forums

The place where Electrical professionals meet.