My problem exits in calculated data
In Excel i want the total m³ a tank was decreased.
Between two timestamps .
Problem is that the volume fluctuates.
If you have two specific points in time:
You can use the PI DataLink 'Archive Value' function to retrieve each value and let Excel subtract the two to find the difference.
This would be the simplest solution. If you're looking to use a PI Expression, you can use the expression TagVal() - TagVal().
If you are trying the find the maximum difference within a given time frame, you would use TagMax() - TagMin() expression for the time range.
You can find all the available PI Expression functions in the the PI Server Applications User Guide.
Welcome the the OSIsoft Community!
If you are interested in the absolute difference between two values, please ignore this post.
But the way I understand your question is as follows:
Suppose we have 5 values in a given time period:
Is the expected result 21? (10 -> 8 = 2 and then 25 -> 6 = 19)
Thx Mike and Lubos ,
the expected result would be 21 indead
Not in the office now but you can try this. PICalcualted data ans using an expression as your source.
If PrevVal('tagname','*')>TagVal('*') then PrevVal('tag','*')-TagVal('*') else 0
Then play around with evenweighted and timeweighted options.
You will have to use a combination of an expression and PI Calculated Data (Expression)
Use the following expression and just add you tank level
if PrevVal('LEVEL','*')>TagVal('LEVEL') then Range('LEVEL',PrevEvent('LEVEL','*'),'*') else 0
In DataLink use the Calculated Data combined with Expression (notice the picture below I selected Expression and NOT Data Item), and make sure you set the "Advanced" options correct as seen below.
Thx Henlo ,
I'll try it next week
Retrieving data ...