Halenger

Newbie - Custom Data Reference?

Discussion created by Halenger Champion on Jan 25, 2011
Latest reply on Feb 9, 2011 by spilon

I'm not sure if this is the best solution, but I'm looking for a way that creates attributes in AF based upon using the calc total function.

 

Background of my project:  I'm collecting a yearly total of flows/demands (water, steam, electricity, etc.) in PI every 15 minutes.  I'm then using a performance equation (PE) to calculate the usage for that time.  In the past, I've used the PICalcVal(...) in excel and such to create reports that give me my total consumption based upon the users time range.

 

Now, with AF, I can't use the total calc over a specif time range (gives me an error that the UOM may be different with TimeRange option, therefore can't do).  Ideally, I'd like to have different, preset time-ranged consumption "attributes" in AF... (Consumption  for 1.) Past Hour, 2.) Current Day, 3.) Previous Day, 4.) Month, 5.) Previous Month, and so on...)  I don't think it should be necessary to have to create a new PI tag for each consumption mentioned above and historize these values when all the data I need to already being calculated via my two tags (Yearly Total and Performance Equation). 

 

So... is this something that makes sense to do with custom data referencing (to acquire different consumption readings for pre-defined time ranges)?  If so, how? If not, what may be another solution?

 

I've read the vCampus white paper "Implementing custon AF 2.0 Data References" and the rollup data reference is what would seem to be the closest to what I'm looking for.  However, I am lost when reading the paper and looking at the code...  If creating custom data reference is applicable for this application, I would need baby-step instructions/guides.  Thanks for the input(s)!

Outcomes