Dear Forum Members,

I need to calculate in PI AF what the totalization will be at the end of the current shift.

A shift lasts 8 hours, from 6:00 to 14:00, from 14:00 to 22:00 and from 22:00 to 06:00

I created a PI Analysis with the following equations:

Tot_Of_The_Current_Shift TagTot('Debit','Current Shift StartTime','*')

PredictiveTot_Of_The_Current_Shift_1 8 * 3600 * Tot_Of_The_Current_Shift / ('*' - 'Current Shift StartTime')

PredictiveTot_Of_The_Current_Shift_2 TagTot('Debit','Current Shift StartTime','Current Shift EndTime')

So, I found 2 ways to calculate the predictive totalization.

Are these equations correct ?

Can I define a future timestamp in the TagTot function ?

Thanks,

Best regards,

Nicolas

Hi Nicolas,

As for your expressions, I personally would prefer

PredictiveTot_Of_The_Current_Shift_1as it clearly illustrates your intent, which is you have a partial shift total and you want to scale it out for the full shift.From Live Library Help for PI Server 2016 R2, there is a TagTot function for tags and a TagTot function for attributes. Both expect the input item to be expressed in units per day. If your 'Debit' is not a daily rate, you will need to apply a conversion factor to get the right value.

For PI Server 2017, there is no change with TagTot for tags, but there is a new parameter for TagTot for attributes, where you may specify the desired output UOM. If it's compatible with the inputs, the conversion is performed for you.

TagTot returns a number without a timestamp. To save the results back to PI, the Asset Analytics

Output Time Stampapplies (from theAdvanced...button). That is you the assigned output time stamp may be one of 3 things:If you choose

Relative to Trigger Time, as you type in the box and enter*+the dialog automatically senses this will be a future timestamp (since you are adding to Now), and presents you with this text:For possible language translators, that would read:

Mapped output attributes require a future PI point to save output history. For newly mapped output attributes that save output history, PI Analysis Service will create future PI points.