Hello...apologies for the delay getting back to you, had to find some spare time!
So if you had a dataset like the following, you get to see what the average was when the processing ends.
Code:
if 'SiteName.ProcessUnit1.Processing' = "False" then TagAvg('SiteName.ProcessUnit1.FeedRate','*',FindEq('SiteName.ProcessUnit1.Processing','*','*-100d',"True")) else NoOutput()
If you had this as a performance equation that is scheduled to run when the value of your "Processing" tag changes you will get what you need. I used a 100 day search period as a default, you can adjust it to what is typical for a processing run.
Basically the PE does the following:
- Checks to see if the value is now False. (Or "Off" in your case)
- Searches backwards in time (for the last 100 days) for when the value was True. (Or "On" in your case)
- An average is calculated from the current time to the time when true was first encountered.
- If the value is not False, then no average value is calculated.
You can put this in ProcessBook as a dataset and trend it to see the behaviour. If you do so, then you will notice it will calculate for every value and not how it would calculate as a Performance Equation that calculates only when the processing flag changes.
Principal Consultant
Real-Time Data Management @ Wipro Technologies