The Tag Tot Function makes the assumption
that all the totalization values being input
are being measured in Units Per Day.
Now, that's a pretty big assumption and,
of course, most process variables are not going to be measured in
Units Per Day. Most Flows are not in Units Per Day.
So, the Assumption of the PI Server
is the same regardless. The Assumption of the PI Server
is always going to be Units Per Day. Now,
if the actual Engineering Units of the PI
tag are Units Per Day you're in luck. The Conversion
Factor's going to be very simple. There really is no need for Conversion
Factor. Just a zer. . .err, just a 1.
Now, the problem comes in when you have
the Engineering Units
are actually in Units Per Hour, or Per Minute, or Per Second,
and, of course, PI's Assumption does not change. It's
still in Units Per Day. So what you're going to need is an,
a Conversion that will convert from this Assumption
of Day
constantly to whatever the actual Engineering Units are.
And it doesn't matter whether you're doing a 2-hour Totalization,
a 12-hour, an 8-hour, or a 24-hour Totalization.
It's the same. Some people think well, what if it's just a
12-hour total. Is it different? No. We're not
converting from an interval of time, we're converting
from the Assumption into Reality. And the Reality
is if you're assuming a Flow is measured in
Units Per Day, but in fact it's measured in Units Per Hour,
you're going to have to multiply that Value by
24. Let's say you are a manufacturer
of widgets, and you make widgets at
the rate of 50. Well, what is that rate?
Is that 50 per hour or 50 per day or what?
Well, let's say you assume it's 50 per day, and you
get a report that says well, today we made 50. Then you
find out later on that wasn't 50 per day, that was 50 per hour.
Very simple. How many hours are there in a day?
There's 24. So, you simply multiply that
number that you got by the number of
hours in a day. So, let me show you another
way of looking at it. Now, here's an example
in which we have a set of
8 minutes, in which we have had a Flow
that has changed 3 times in 8 minutes.
So for the first 3 minutes it was
just the Flow was right around 3 Engineering Units,
and then for 2 minutes it was 5 Engineering Units,
and then for 3 more minutes it was
1 Engineering Unit. Now,
if you knew right going into this
that this is measured in Units Per Minute,
if that's what your Engineering Unit of the Flow is,
it's a pretty simple calculation. It's this first calculation
that you see here. You would just simp,
simply take that 3 Gallons Per Minute, multiply
that by 3, that would be 9 Gallons.
You take the 5 Gallons Per Minute, multiply it by 2,
'cause see it was 5 Gallons Per Minute for 2 Minutes,
so that's now 10 Gallons + 9, that's 19
Gallons, and then take this last number here,
for 3 Minutes it was at 1 Gallon Per Minute, so it's 19
Gallons Per Minute + 3 Gallons -- total of 22
Gallons. Okay, so far so good. That's a pretty simple
calculation. You know, if you,if you know up front
that you're measuring Gallons Per Minute and,
for example, you're trying to figure out what came in during this
2-minute period, that's real simple. For 2 Minutes
it was 5 Gallons Per Minute. That's 10 Gallons, right?
Well what if you weren't that well-informed when you
started out this calculation. Instead of Gallons Per Minute,
for some reason you thought that this was coming in
in Units Per Day. Because, see, that's exactly
what PI's doing. PI doesn't know about
Gallons Per Minute. PI is assuming Units Per Day.
So, how does it do that calculation? It does it
by looking at this 2 minutes here, you know, which the Value
is 5, and it says oh, 5, that's 5
Units Per Day, 5 Gallons Per Day.
So, how much did I actually bring
in in 2 minutes? Well, in 2 minutes,
at the Rate of 5 Gallons Per Day, you know, it
ends up being this 5 Gallons
divided by, or excuse me, 5 Gallons
Per Day times the 2 Minutes, but that's
at a Rate of 1 over 1440.
It's, you know, that's one day's worth of Flow
divided by 1440 Minutes because we're figuring
that this is 2 Minutes, so 2 Minutes of Flow
ends up being, you know, this 5 Gallons Per
Minute divided by 1440 - a very small number.
And we're going to do that for all of these. You know, each one of
these we're basically taking the, whatever
that Flow amounts to, we're dividing that by
1440, because we're assuming this is in Gallons
Per Day instead of Gallons Per Minute. Now,
to solve this problem, which you end of having to
do, is to multiply the result that we get
by 1440. That's the number of minutes in a day.
How did this all happen? Why,
why is it that we're making this Assumption of Units Per
Day? It's just that the Engineering Units
Field in the PI Server originally started out
as a pure Text Field. It still is for the most part,
except in some of our other Applications like AF.
So the Engineering Units is a simple Text Field. We
assume all Flow Units are in Units Per
Day for purposes of Totalization, even though it may say
Gallons Per Minute. PI doesn't really know that it
is Gallons Per Minute, so it assumes everything is in Units
Per Day. And if I can offer one more
example. Imagine that you are making widgets.
You're manufacturing at a Rate of 50 widgets. Well,
unless you know what the Rate is,
50 widgets doesn't really mean anything. Now if you're making
50 widgets per day, and at the end of
24 Hours you've got 50 widgets. However, if you
discover then you're making 50 widgets per hour, not 50
widgets per day, then you take that 50,
you multiply it by the 24 hours you've been making widgets, and
that's how many widgets you have. That's the Conversion Factor.
And, by the way, it has nothing to do with
the Interval of Time. If you notice, this Interval of
Time, here, this is just an 8-minute interval. That doesn't,
the Conversion Factor we used, doesn't matter whether this is 8 minutes
or 8 hours or 8 days. We've going to use that same Conversion
Factor. Essentially what it is, it's a
conversion between the Reality
of a PI tag, Hours, Minutes,
and Seconds, and the Assumption PI makes.
PI makes the Assumption of Day for all of those.
Now, thankfully, you're only going to have about 3 Conversion Factors,
or 4 Conversion Factors: these right here. Every once
in a while you might see something weird like if you're measuring a Flow
Rate in Units Per Half-Hour, you'd end up having to make this
48 instead of 24. We see
odd things like that, but generally we don't. And one more thing,
while you're converting,
for example from, let's say you're measuring thousands of Gallons
Per Minute, and you want a report in Gallons
Per Minute, not thousands of Gallons, you could just
add some zeroes to the end of this and
that would end up -- just add 3 zeroes -- that would
convert both your, the proper
Rate Conversion, and also convert from thousands of
Gallons Per Minute into Gallons. One more
consideration is what happens when we have data that's
missing. Let me draw a little Trend here. Let's
say, for example, you've got data that looks like this.
You're gathering data, everything's going along fine,
and then the data's unavailable for a period of time,
and then it comes back, and this is what your data looks
like at the end of the day. Well, what do we do
with this missing data? With the data missing here,
we don't just leave that blank.
What we end up doing for this missing data for this period of time
right here, is we take the average for the
rest of the period. So we take the, this period of time,
this period of time, we average that out, and that's what we
come up with to substitute for the missing data. So we,
we essentially substitute the average of the
rest of the period to produce a full
Totalization for the given period of time.
In some cases people say we don't like that, we can't report that to the
state agencies, or the EPA, or the governing body.
Well, we need to do is simply say that we don't have
the, the Totalization for that period.
Well, one of the ways we suggest you do that
is you can use this Percent Good Function. Okay?
With the Percent Good Function, you can do an If-Then-
Else Statement that says, you know, if the Percentage
Good is not greater than, say, 98 percent of whatever
the requirement is, then simply return Bad
Value, so that that doesn't go into a report when it can't
be verified.