Automation Glossary • Step vs Linear Interpolation

When Should a Query Use Step Instead of Linear Interpolation?

Merobix Engineering • • 8 min read

A historian stores a value only when it changes or when a scan fires, so almost every point on a trend line between two stored samples has to be filled in by a rule chosen at query time. That rule is the interpolation mode, and there are two common choices: hold the last value flat until the next one arrives, or draw a straight sloped line between the two. Picking the wrong one is one of the most common and most invisible mistakes engineers make when they build a report or read a trend, because the chart still looks plausible while quietly implying values that were never true.

Back to Blog

Step vs Linear Interpolation in one line: Step interpolation holds the last stored value flat until the next sample, drawing a staircase; linear interpolation draws a sloped straight line between two samples. At query time you choose step for tags that hold a value between changes - digital states, setpoints, mode selections, counters - and linear for continuously varying analog measurements like pressure, temperature, and flow. Using linear on a state tag invents transitions that never happened, and using step on a smooth analog signal understates what the sensor was actually doing between samples.

The Decision Rule Engineers Get Wrong

The rule is simpler than it is usually made to sound: interpolate the way the underlying signal actually behaves between samples. A digital or discrete signal does not drift between the moments it is logged - a pump is either running or stopped, a valve is open or closed, a control mode is auto or manual, a setpoint sits at whatever number an operator last entered. For these, the true value between two stored points is the earlier value, unchanged, right up until the instant it changes. Step interpolation, also called sample-and-hold or last-value-carried, reproduces that exactly, giving the flat treads and vertical risers of a staircase. Linear interpolation on the same tag is simply wrong: it draws the pump smoothly ramping from 0 to 1 over ten minutes, or the setpoint gliding from 50 to 60 across an hour, neither of which ever happened.

A continuously varying analog measurement is the opposite. Pressure, temperature, level, and flow move smoothly through every intermediate value, so when a historian stores a sample at 50 and the next at 60, the signal genuinely passed through 55 somewhere in between. Linear interpolation is a reasonable estimate of that path, and it makes trends readable and integrals sensible. Step interpolation on an analog tag produces a jagged staircase that holds each reading flat and then jumps, which both looks wrong and biases any area-based calculation, because it treats the whole interval as if it sat at the older value until the very last instant.

The reason this gets fumbled is that the choice is often buried. Many tools apply one default interpolation to every tag, or store the mode as a per-tag flag that nobody revisits, so a report author never consciously decides. The safe habit is to treat interpolation as a property of the signal's physics, decided per tag: anything that steps between discrete states gets step, anything that varies continuously gets linear, and anything you are unsure about you check by asking whether the signal could have taken any value between the two samples.

How the Wrong Mode Corrupts Reports and Trends

The damage from the wrong mode is rarely a dramatic error; it is a quiet distortion that survives review because the output still looks reasonable. Consider a duty-status tag that shows which of two pumps is lead. Stored as changes, it is a handful of points a day. Interpolated linearly, a report that samples it on a grid sees fractional values like 0.3 or 0.7 partway through a switch, which are meaningless for a state that is only ever 0 or 1. Any downstream logic that thresholds or counts on that tag will miscount transitions and mis-time durations, and a runtime calculation built on it will attribute impossible in-between states to the equipment.

The reverse error hurts analog integration. If a flow rate is held flat with step interpolation and then integrated to a volume, every interval is credited with the older, lower or higher reading for its entire span instead of the true sloped path, so the total drifts away from reality in a direction that depends on whether the rate was rising or falling. On slowly changing signals with frequent samples the bias is small; on aggressively compressed data where samples are far apart, the same choice can move a daily total by a visible amount. Because the number is still in the right ballpark, it often ships.

The practical defense is to make interpolation explicit and to verify it visually. Overlay the stored sample markers on the interpolated line: on a state tag you want to see clean rectangular steps landing exactly on the change points, and on an analog tag you want a continuous line that passes through every marker. When a trend shows a setpoint sloping or a digital signal ramping, the mode is wrong, not the data. Catching that at the trend is far cheaper than discovering it in a monthly total that has already been reported.

Choosing the Mode in SCADA and Cloud Monitoring

In a SCADA and historian environment the interpolation mode is where the shape of stored data meets the way people read it, and remote field operations make the choice matter more, not less. Telemetry from wellpads, compressor stations, and lift stations is usually compressed and exception-based to save bandwidth, so stored points are sparse and far apart. The wider the gap between samples, the more of the trend is interpolation rather than measurement, and the more the mode governs what an operator actually sees. A sparsely sampled analog pressure needs linear interpolation to read as the smooth curve it really was; a sparsely sampled run/stop or open/closed status needs step interpolation so a brief state does not smear into a ramp.

A cloud SCADA platform such as Merobix ingests both kinds of tag from every remote site into one historian, and the safe pattern is to carry the right interpolation intent with each tag so that trends, reports, and calculations all agree. State and setpoint tags are treated as stepped so a duty change or a mode switch shows as a crisp transition at the moment it happened; analog process measurements are treated as linear so trends and area-based aggregates reflect the true between-sample path. When the same tag feeds an operator screen, a daily volume report, and an alarm review, having one consistent, physically correct interpolation choice keeps all three telling the same story.

The field-operations payoff is trust. An operator scrolling a week of history on a remote separator wants to believe that a flat stretch on a status line means the equipment truly held that state, and that a sloping analog line means the sensor genuinely moved that way. Getting step versus linear right per tag is what makes that literal reading correct, so that a trend can be used for troubleshooting and a report can be used for accounting without a mental asterisk about which segments are real and which are the interpolation guessing.

Frequently Asked Questions

How do I decide between step and linear interpolation for a tag?

Ask whether the signal could take any value between two stored samples. If it varies continuously, like pressure, temperature, level, or flow, use linear so the trend and any area calculation follow the true path. If it holds a value between changes, like a digital state, a setpoint, a mode, or a counter, use step so the value stays flat until it actually changes. The choice is a property of the signal's physics, not a display preference.

What goes wrong if I linearly interpolate a setpoint or digital tag?

Linear interpolation invents transitions that never happened. A setpoint that jumped from 50 to 60 appears to slope gradually between the two, and a digital status that switched from off to on appears to ramp through fractional values like 0.4. Any logic that counts transitions, measures state durations, or thresholds the tag will then be wrong, because it is reading interpolation artifacts as if they were real intermediate states.

Does the interpolation mode affect totals and averages?

Yes, strongly, especially on sparsely stored data. Step interpolation credits each interval with the older reading for its whole span, which biases any integral or time-weighted average relative to the true sloped path that linear interpolation follows. On analog rates that are integrated to a volume or energy, using step instead of linear can shift a daily total in a direction that depends on whether the value was rising or falling, so the mode should match the tag before any area-based figure is trusted.

From Definitions to a Live Dashboard

Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.

Request a Free Demo +1 (903) 307-7300
More in Automation Glossary
LOCF Gap Fill  •  Null vs Zero Gaps  •  Time Alignment  •  Regular vs Irregular Series  •  Continuous Aggregate  •  Series Cardinality  •  All Automation Glossary →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →