Hi all,

I am trying to use the TagTot function to totalize power over a period of time. More specifically, I have a PI tag storing an instantaneous kW reading and am trying to calculate a monthly kWh from this tag. I understand that the TagTot function assumes the variable being totalized is expressed in units per day. If not, an adjustment has to be made to the output of the function to account for this. For example, the result produced by TagTot for a flow rate variable expressed in gallons/hour would have to be multiplied by 24 hours to calculate the gallons flowed over a day. What I am unsure of is how this works when dealing with a kW reading, since it has no time unit associated with it.

Let's assume the instantaneous kW reading is 10 kW for an entire month. TagTot over that month (assuming 31 days) equals 310 kW. In other words, PI thought 10 kW were generated per day, so 310 kW must have been generated that month. However, 10 kW were actually generated at any given time that month. So what is needed to adjust the TagTot result to be in kWh? Presumably it needs to multiplied by the number of hours per day (i.e., 310 kW * 24 hours = 7,440 kWh). Does that make sense? Appreciate any insights you can share!

Thanks

EDIT: Looking at this simple kWh calculator, 7,440 kWh would appear to be the correct result, but if somebody could confirm my approach, I'd appreciate it

The issue is that kW, a power, is secretly a rate. The reason for this is that one watt is equal to one Joule per second. Wikipedia is actually a good method to look into this: Watt - Wikipedia, the free encyclopedia . In PSE, you can see this information by looking at the UOM Class that holds KW, that is the Power UOM class. kW and kWh are convenient units to use as it is easy to do the the math, one kW being consumed for one hour is an energy consumption of one kWh. To do this using Joules per second and Joule, you could do the same calculation, but it would not be so easy.

Your approach is valid, but here is one that I have used to avoid the conversation factor.

I have an attribute in kW. So that I can use it in TagTot, I need to convert to a rate that is in days. With the discussion about, this would be in J/d:

This child To Days attribute is easy enough to define:

The analysis now correctly returns to me the values in Joules (this is a new feature since 2015 R2)

Now, to see things in kWh in my mapped attribute, all I need to do is to specify that its source units is in Joules.

Joules per day is not defined by default in AF, but you can defined it as follows:

I admit this method requires a lot more configuration in the part of AF, but if you do TagTotal for several different rates, this method can be used to handle all of them in a uniform way.