Case: we have a stockpile which is fed (adds inventory) by a conveyor (with scale read in tons/hour) and pulled by another conveyor (also with scale) that reduces inventory.
A survey is also done regularly to "reset" the value to proper levels of the inventory (in tonnages).
So here is the general logic:
A = surveyor input (say done weekly)
B = Inventory added (in tons). totalizer value every hour
C = Inventory reduction (in tons). Also totalized value every hour
D = Estimated inventory (tons).
Executed every hour (sample time):
D = A + B - C
A = D
A updates every hour except when overwritten with new survey result.
Where can this be done in PI and how?