Automation Glossary • DNP3 Frozen Counter

What Is a DNP3 Frozen Counter?

Merobix Engineering • • 6 min read

Reading a counter that is still counting gives you a value that was already stale the instant it left the device. DNP3 solves this for totals - volumes, pulse counts, run hours - with the freeze operation, which snapshots a counter at a defined instant. This page explains what a DNP3 frozen counter is, how the freeze command works, and why it matters for billing-grade and interval totals.

Back to Blog

DNP3 Frozen Counter in one line: A DNP3 frozen counter is a snapshot of a running counter captured at a specific instant by a freeze command, so a master reads a stable total rather than a value still incrementing. The outstation copies the live counter (group 20) into a frozen counter (group 21) on command, optionally clearing the running counter in the same operation. Freezing many counters at once gives a consistent set of totals taken at the same moment across an outstation.

Why Freeze a Counter

A counter is a monotonically increasing total - meter pulses, a volume totalizer, accumulated run time. If a master simply reads the live counter, the value is a moving target: it changed between when the outstation sampled it and when the master received it, and two counters read on separate polls do not represent the same instant. For interval totals and any billing-grade reading, that inconsistency is unacceptable.

The freeze operation fixes it. On a freeze command the outstation copies each live counter into a companion frozen counter at one instant. The master then reads the frozen values, which are stable and represent a common point in time. A broadcast or multi-point freeze captures a whole set of totals simultaneously, so the numbers add up correctly across a site - the DNP3 analog to how a flow computer latches a totalizer at an interval boundary.

Freeze, Freeze-and-Clear, and Counter Rollover

DNP3 offers freeze on its own and freeze-and-clear, which snapshots the counter and then resets the running counter to zero in the same operation. Freeze-and-clear is how per-interval totals are built: each interval starts from zero and the frozen value at the end is that interval's quantity. Plain freeze leaves the running total intact, giving a cumulative reading.

One thing to plan for is rollover. A counter of finite width eventually wraps back to zero, which is a normal event, not an error - the same behavior as a counter rollover in a totalizer. When totals are computed from frozen readings across a rollover, the arithmetic must account for the wrap. Understanding freeze also means understanding that the frozen counter and the running counter are two separate objects the master can read independently, so a mismatch between them at a given moment is expected, not a fault.

Fitting Freezes Into the Polling Plan

A freeze does not happen unless something issues it, so the freeze schedule is part of the master's polling design, not an outstation default. The usual pattern is a freeze at each accounting boundary - top of the hour, end of the contract day - followed by a read of the group 21 points, all sequenced so the frozen set is safely collected before the next boundary arrives. On a congested channel that sequence competes with everything else the master does, so it pays to plan it alongside your integrity and event poll rates rather than bolting it on afterwards.

Broadcast freezes capture every outstation at once but are unacknowledged, so a careful master follows the broadcast with per-station reads and treats a missing response as a flagged interval. The freeze-at-time variants shift the trigger into the outstation itself: the device freezes on its own clock at the configured boundary, which removes the dependence on the channel being up at that exact instant - valuable on cellular or satellite links. That only works if outstation clocks are right, which is why time sync and event timestamps deserve verification before anyone trusts time-scheduled freezes.

A Worked Interval, in Symbols

Call the frozen reading collected at boundary k F(k). With plain freeze the interval quantity is the difference of successive snapshots: Q = F(k) - F(k-1). If the counter wrapped once during the interval the difference goes negative, and the correction is Q = M - F(k-1) + F(k), where M is the rollover modulus for the counter's width - 2 to the 32nd power for a 32-bit point. With freeze-and-clear there is no subtraction at all: the frozen value is the interval quantity, because the running counter restarted from zero at the previous boundary.

A reconciliation habit worth keeping: trend the live group 20 counter as well as the frozen values. The sum of your interval quantities should track the growth of the cumulative counter, and any divergence between the two is an early, cheap signal that a freeze was missed, a wrap went uncorrected, or a device restarted and reset its count.

Plain Freeze or Freeze-and-Clear: Picking One

The table contrasts how the two behave when things go wrong, which is the real basis for choosing:

AspectPlain freezeFreeze-and-clear
Frozen value meansCumulative total at the freeze instantQuantity accumulated since the last clear
Interval arithmeticSubtract successive frozen readingsUse the frozen value directly
A missed freezeNext reading spans two intervals; the total is still recoverableTwo intervals merge and cannot be separated afterwards
Device restartVisible as a cumulative total that stepped backwardsHarder to distinguish from a genuinely small interval

Plain freeze is the forgiving choice for anything with audit weight, because the cumulative total survives every mishap and the intervals can be re-derived from it. Freeze-and-clear buys simpler arithmetic at the cost of being destructive: once the counter is cleared, the history it held exists only in the reading you did or did not manage to collect.

Frequently Asked Questions

What is the difference between a counter and a frozen counter in DNP3?

A counter (group 20) is the live, still-incrementing total. A frozen counter (group 21) is a snapshot of that total taken at a specific instant by a freeze command. The master reads the frozen value to get a stable, time-consistent total.

What does freeze-and-clear do?

It snapshots the counter into the frozen counter and then resets the running counter to zero in one operation. It is how per-interval totals are built - each interval begins from zero and the frozen reading at the end is that interval's quantity.

Why freeze multiple counters at once?

So that a set of totals all represent the same instant. Reading counters individually on separate polls captures them at different times; a single freeze command snapshots them together, which is essential when the totals must be summed or reconciled against each other.

What happens if a freeze command is lost?

With plain freeze, nothing is destroyed: the next successful freeze produces a snapshot spanning two intervals, and the cumulative total lets you apportion or at least flag the gap. With freeze-and-clear the two periods merge irreversibly, since the counter kept accumulating into a single bucket. Either way the accounting system should mark the affected interval as estimated rather than silently accepting it.

Can a frozen counter be reported as an event?

Yes. DNP3 defines frozen counter events in group 23, so an outstation can queue a frozen value with its freeze time and deliver it through event polls or unsolicited responses instead of waiting for the master to read group 21. Whether a particular device supports that, and in which variations, is declared in its device profile, so check there before designing the collection scheme around it.

Sources and verification

This page references the protocol specifications published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.

Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.

More in PLC, RTU, HMI & DCS
High-Speed Counter Module  •  PLC Counter (CTU/CTD)  •  HART Config Change Counter  •  DNP3 Analog Output Block  •  DNP3 Sequence of Events  •  All PLC, RTU, HMI & DCS →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →