Dear community,

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:

Let :

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?

Thank you!

bud

Hey Bud,

Here's how I envision your setup, assuming none of this has yet been set up in PI:

A, B, C and D are all PI tags. We also have tags E and F, which are the "Tons / Hour" values of the conveyors.

E and F get their data from a

PI Interface or Connector: PI Interfaces and PI Connectors .Then we use

Analysesto totalize the values of E and F, placing the results in C and D. Check out these links on Analyses:OSIsoft: How to Setup Expression Analyses with PI AF [PI AF 2014- v2.6.0.5843] - YouTube

PI Server

For the totals, we can use the convenient TagTot function. A list of the functions available with Analyses is available here: PI Server

For A and D, we set up analyses which execute once per hour. They first check the timestamp of A and D. If the value of A or D has been overwritten with a new survey result, the timestamp will be less than one hour old. In this case we don't do anything. If the value is one hour old or older, we know the value has not been overwritten. In this case we perform the calculation:

D = A + B - C

A = D

And write the calculated values to A and D.