I want to calculate tagtot then BIT=1 only. The period starts BOM('*') till '*'. Without condition i can to calculate.
I would suggest PI AF analysis for archiving this functionality
Filtereddata= If(‘BIT’=1) then 'Tag1' else NoOutput() // write to intermediate output attribute
Filteredtagtotal= TagMean('Filtereddata’,'1',' *') * EventCount('Filtereddata','1',' *') // write to output result attribute
Thank you. I will try this way.
TagMean - it is AVERAGE value.
EventCount - quantity of event. (if i have 1 event, Total will be equal TagMean? )
Tag Mean is the event weighted average of the events. This is different from the time weighted average.
If you have only 1 event, then yes, Tag Mean will be equal to the event weighted Total.
I sow in other side. Something will be useful for me. Thanks.
We have a flow meter.
We have a different product, which go through flow meter. I want to calculate how much ton each product we produced.
We have tag "code product" in the tube. (our condition).
We have tag "flow meter" t/h (our speed)
We have tag "Total Flow" t (general mass)
I want to create tag which show the change total flow in on-line mode for each product.
In PiAF i have different assets for code product. And only one flow meter.
I want to show it in PI VISION. Changing Assets i will see different tot flow for current product.
Now i do next way.
But i see only last timestamp total.
How to calculate SUM of maximum from 'timestamp total' started BOM('*')?
I would recommend doing as Lal Babu Shaik suggested. You will want to write out to an intermediary tag or using an analysis with no data reference using logic such as:
First Analyis: if 'BITS_IN_CALC' then 'FLOW_IN' else '0'. (map this to a PI Point and optionally save history)
Second Analysis: if '*' = BOM('*') then 0 else if BIT_Calc_IN' then TagTot('filtredFlow', BOM('*'), '*') * 24 else NoOutput()
I am not sure how many of these have, but as you can imagine, going back to the start of each month each second can be expensive expensive. Options include rolling up into days, and then into months. Changing schedule to not execute as often.
See the first solution in this KB article: KB01120 - Filtered calculations in Asset Analytics . It uses a formula, but an analysis that does not write back to a PI Point is very similar to a formula.
Dan, I am testing now this model. I have already created that expression. But i try second part to calculate in Value retrieval methods. Next i will monitor in PI VISION. Thanks!
P.S. хорошая мысля приходит опосля
It is Working. Thanks.
Retrieving data ...