PROGRAM FlowTotalizer
TON_Totalizer(NOT(TON_Totalizer.Q), T#10s);

IF TON_Totalizer.Q THEN
	Flow_Today := Flow_Today + (Flowrate * (10.0 / 60.0));
END_IF;

IF ((CurrentTimeRTC.hour = 0) AND (CurrentTimeRTC.minute = 0) AND (CurrentTimeRTC.second = 0)) THEN
	Flow_Yesterday := Flow_Today;
	Flow_Today := 0.0;
END_IF;

END_PROGRAM