How-to
Configuring a PI Historian totalizer with a condition filter
Short answer
The condition belongs in the Sampling tab of the PI-SMT Totalizers plug-in: check Filter the source data with the following expression and enter 'ATag' > 100. The source tag CTagSource, the calculation and the every-minute schedule stay untouched; the filter only decides which source events contribute.
On this page
- Where is the totalizer condition setting in PI-SMT?
- What expression goes in the source-data filter?
- Does the filter change the every-minute result schedule?
- How do I apply the filter without disturbing the working totalizer?
- What should ATag read before you trust the gate?
- How do I prove the gated total is correct?
- What comes out during minutes with no qualifying data?
- Should the totalizer be rebuilt in Asset Analytics instead?
- Questions asked
Your totalizer already delivers a result every minute from CTagSource, so the operating condition is the only missing setting. Open BTagTotalizer's definition in the PI-SMT Totalizers plug-in, go to the Sampling tab, check Filter the source data with the following expression, and enter 'ATag' > 100. The source tag, the calculation, the units and the every-minute schedule stay exactly as they are; the filter only decides which source events are allowed to contribute.
Where is the totalizer condition setting in PI-SMT? #
It sits in the Totalizers plug-in of PI System Management Tools (PI-SMT): load BTagTotalizer's definition, open the Sampling tab, and the option Filter the source data with the following expression is the condition gate you need. The PI Server documentation for the Totalizers plug-in presents this option as the way to filter the source events a totalizer uses. It is a calculation gate, not an alarm limit and not a display rule — nothing on the operator interface changes when you set it. The setting belongs to BTagTotalizer's own definition, so it does not reach any other totalizer on the same server.
What expression goes in the source-data filter? #
Enter 'ATag' > 100, written in Performance Equation (PE) syntax: the single quotes identify ATag as a point reference, and the comparison is true only above 100, so only qualifying source events reach the total. Filter fields across PI-SMT take PE syntax, and standard numeric comparisons such as > are written directly. Two placement rules keep the edit safe. The expression belongs in the filter field, not in the source selection: CTagSource stays the source, and the filter only gates the events drawn from it. And if a filter already exists, read its logic before replacing it — deleting someone else's operating condition silently changes which data qualifies.
Does the filter change the every-minute result schedule? #
No. The result schedule and the source-data filter are separate settings: the schedule decides when BTagTotalizer produces a result, the filter decides which CTagSource events qualify, and neither rewrites the other. Three settings, three jobs:
| Setting | Where it lives | What it controls |
|---|---|---|
| CTagSource | Totalizer source selection | the quantity being totalized |
| 'ATag' > 100 | Sampling tab, source-data filter | which source events are admitted |
| Every-minute output | Result timing configuration | when results are produced |
Change only the middle row. Holding the source, calculation, units and timing constant is what makes the before-and-after comparison a test of the condition alone rather than of five settings at once.
How do I apply the filter without disturbing the working totalizer? #
Record the definition as it stands, add the expression on the Sampling tab, apply it through the plug-in's save workflow, then verify against recorded data — the seven steps below change nothing else.
- Record the current definition for BTagTotalizer: source tag, calculation, units, sampling settings and the every-minute result schedule, so the change can be reversed exactly.
- Open the PI-SMT Totalizers plug-in and load BTagTotalizer's definition.
- Apply the Sampling-tab edit described above in the filter field.
- Save and apply the change through the plug-in's configuration workflow, then reopen the definition to confirm the expression persisted and CTagSource is still the source.
- Read ATag as a point — value, timestamp and quality — and mark the periods genuinely above and below 100.
- Verify against recorded operating data or an authorized controlled test; do not drive a live process across the threshold just to exercise the historian.
- Trend the three tags across a transition and note what an all-false minute produces in the output.
What should ATag read before you trust the gate? #
ATag must be a live, good-quality numeric point reading strictly greater than 100: read the point itself with its value, timestamp and quality rather than trusting a screen label such as 'running'. The comparison is strict — a reading of exactly 100 fails, and only values above it pass. Near the threshold, repeated crossings admit and reject source data within the same minute, so judge from the recorded trend rather than from one current value. If ATag disagrees with what the process is doing, trace its scaling, point mapping and acquisition path back to the controller: a correct filter applied to the wrong engineering value still produces the wrong operating window. Boundary chatter is fixed with a separately defined condition tag that has hysteresis, because this filter implements only ATag > 100.
How do I prove the gated total is correct? #
Trend ATag, CTagSource and BTagTotalizer together across a window containing a threshold crossing, and check that the output advanced only during qualifying minutes — the worked numbers below show the arithmetic. Illustrative example: CTagSource reports a rate in cubic metres per hour and the totalizer integrates it each minute.
| Minute | ATag | CTagSource (m³/h) | Qualifies | Volume (m³) |
|---|---|---|---|---|
| 14:00 | 85 | 100 | no | 0 |
| 14:01 | 104 | 120 | yes | 120 ÷ 60 = 2.0 |
| 14:02 | 130 | 90 | yes | 90 ÷ 60 = 1.5 |
| 14:03 | 100 | 140 | no, equal fails | 0 |
| 14:04 | 118 | 60 | yes | 60 ÷ 60 = 1.0 |
Filtered total: 2.0 + 1.5 + 1.0 = 4.5 m³. Without the filter the same window gives (100 + 120 + 90 + 140 + 60) ÷ 60 = 510 ÷ 60 = 8.5 m³, so the condition removed 4.0 m³ that arrived while ATag was at or below 100.
Dividing by 60 converts an hourly rate to a per-minute quantity and assumes the totalizer is integrating that rate as configured, so check the calculation type against what CTagSource actually is: integrating a rate, summing discrete amounts and re-reading an already cumulative counter are different configurations. The unconditional total already works, so preserve those settings unless a units error appears on its own. To align the three tags minute by minute, export the historian trend as CSV at one-minute intervals and compare each qualifying minute against the output step. The comparison is a straight archive read, because the PI Data Archive stores tag data in its own files rather than a SQL Server database (how the PI Data Archive stores tag data).
What comes out during minutes with no qualifying data? #
The definition itself decides, so establish it once from recorded data: read BTagTotalizer across a window you know ran below 100 and note whether it wrote zeros, held its last value or wrote nothing at all. The three outcomes mean different things downstream — a zero says 'counted, nothing qualified', a held value says 'no new information', a gap says 'no event was written' — so record which one your definition produces and make reports treat it consistently. If BTagTotalizer shows a current value but no history at all, that is a separate archive-side fault rather than filter behaviour; why PI shows live values but no trend history covers that diagnosis.
Should the totalizer be rebuilt in Asset Analytics instead? #
Not for this change. Adding one filter to a working every-minute totalizer is the smaller, reversible edit; Asset Analytics in AF, with the array implementation available since the 2018 release, is the newer layer for asset-based calculations. Both mechanisms produce this gated sum, so the decision rule is scope, not age: the totalizer is the older PI Data Archive feature and Asset Analytics the newer analysis layer. Keep the totalizer while the calculation is one point feeding one output; move to AF when the same gated sum must exist per asset — one instance per pump, per line or per production area. When you migrate, run the AF analysis and BTagTotalizer in parallel over a period that includes threshold crossings and compare the outputs before retiring the totalizer.
The decision for your case: on BTagTotalizer's Sampling tab, check the source-data filter option, enter 'ATag' > 100, change nothing else, and verify across one transition. Use a greater-than-or-equal comparison only if a reading of exactly 100 must count. Rebuild in AF only when the calculation becomes asset-based, not to add this condition.
Questions asked
Does 'ATag' > 100 include a reading of exactly 100?
No. The comparison is strictly greater than, so a value of exactly 100 fails the filter and that source data does not contribute. If the boundary itself must count, change the comparison to greater-than-or-equal, written >= in PE syntax, then re-verify the totals in a window that crosses 100.
Can the filter gate on two tags at once?
Yes. The field takes an expression rather than a single comparison, so you can combine conditions with the PE logical operators, for example 'ATag' > 100 AND 'PumpRunning' = 1. Confirm each condition separately first, so a logic error in one term is not mistaken for a syntax problem in the other.
Does the filter apply to every totalizer on the server?
No. The source-data filter belongs to the individual totalizer definition, so the expression you enter for BTagTotalizer does not affect any other totalizer on the same PI Data Archive. Each definition carries its own Sampling settings, including its own filter.
Why did the displayed total keep changing after I added the filter?
Check three things in order: that the change was saved and applied through the plug-in's configuration workflow and still appears when you reopen the definition; that the display binds to BTagTotalizer rather than directly to CTagSource; and that ATag, read as a point with its timestamp and quality, is genuinely above 100 during the minutes you are questioning.