Hi,

I'm working on an ACE calculation that does a time-weighted average of total discharge over a period of 24 hours. The calculation period is from 12:00 PM today to 11.59 AM tomm . The calculation should reset the PI tag value to zero at noon every day. How do I accomplish this? My current logic doesn't seem to work for all time stamps:

Dim startTime As PITime = Noon(Me.ExeTime)

Dim startTimeUTC As AFTime = New AFTime(startTime.UTCSeconds)

If (lastCalculationTime.UtcSeconds >= startTimeUTC ) Then 'Check if lastCalculationTime in UTC is less than UTC second at noon

lastCalculationTime = startTimeUTC

lastCalculatedValue = 0.0

End If

Any assistance is truly appreciated.

Thanks,

Arti

A quick 'n dirty trick: Your ACE output tag can be a Performance Equation tag.

If you create a time scheduled PE tag where the expression is 0.0 and the scan class is 00:00:00 you will have it reset to 0 from the PE scheduler, and you don't have to define this within the bounds of your ACE project.

If you don't want to do that, I'd have to ask if your ACE calculation is time scheduled or naturally schedule (triggered from one or more PI tags)?