Is there a way to create a PI tag that calculates the difference of a PI tag at Yesterday (Midnight) and Today (Midnight) ??
You can use use an Expression AF Analysis (preferred) or Performance Equations to do this. The TagVal() function is what you would want to use to get the value of a tag at a specific time. So, the equation would look something like this:
TagVal('Tag1','y') - TagVal('Tag1','t')
Retrieving data ...