A fixed offset cannot tare a scale signal that never returns to electrical zero. Capture the raw analog input into a stored register at the qualified empty point, then compute weight as (raw minus tare) times gain. Gate the capture to a settled reading at that point, and a residual that releases later cannot pull a full discharge negative.
A scale signal that never settles back to exactly zero is a tare problem, and solving it in logic is simpler than it looks. You capture the analog input's raw value once, at the moment the vessel is genuinely empty, keep it in a stored register, and subtract it from every live reading before the gain is applied. The arithmetic is the easy part. The decision that matters is when the capture is allowed to fire, because a capture taken while a few pounds of material still hangs in the hopper becomes a negative reading the day that material drops free. This page walks through the scaling, the capture logic and the checks, and carries a batching hopper through the numbers.
How do I tare a scale signal that never returns to exact zero?
Store the raw analog input value in a tare register at the moment the vessel is qualified empty, then compute weight as (raw minus tare) times gain. On a 0-10 V conditioner this works whether or not the signal ever returns to electrical zero.
A fixed offset is a number measured once, and a conditioner-fed channel moves around it: trim shifts, temperature, a few counts of drift between cycles. The tare register is the same offset, re-measured each cycle at the point where the process defines zero. The signal never has to touch 0 V. Whatever the conditioner sits at when the vessel is empty becomes the stored baseline, and the running calculation subtracts exactly that:
weight = (raw - TARE) * gain
The subtraction happens in counts and the gain converts the difference to pounds, so each value keeps its own unit and the baseline renews itself every cycle.
What do I need before writing the tare logic?
You need four things: the raw input value in its native counts, a stored tare register of the same data type, a gain in pounds per count, and a one-shot capture condition tied to the sequence's empty step.
Concretely:
- The raw channel value in counts, exactly as the analog input module delivers it, before any scaling.
- A tare register: one retentive integer, same width and data type as the raw channel, holding one snapshot per cycle.
- A gain as a floating-point constant, in pounds per count, from two-point calibration (0.4884 lb per count in the example below).
- A capture gate: the sequence's empty step, a residual threshold, and a settle window.
- A rising-edge or one-shot instruction for the copy.
- A numeric display on the HMI for the result. If your panel software expects that result as a 32-bit float split across two word registers, displaying a PLC float stored in two word registers on an HMI shows the register layout.
Keep the tare register separate from any fixed calibration offset left over from commissioning. One of them owns electrical zero; if both end up inside the same subtraction, the correction lands twice.
How do I scale the raw input to pounds?
Scale with a two-point calibration: apply a known minimum and maximum load, record the raw counts at each, then gain = (weight at max minus weight at min) divided by (counts at max minus counts at min), so a 2000 lb span over 4095 counts gives 0.4884 lb per count.
Two-point calibration is the standard method for a linear analog channel, and it requires two known loads and two recorded counts. Put the known low weight on the vessel (empty, or a test weight) and record the raw counts. Put the known high weight (a full batch or a calibrated test load) and record again. The slope falls straight out:
gain = (weight_high - weight_low) / (counts_high - counts_low)
The tare form is the same line written a different way: the intercept expressed in counts is exactly what the capture stores, which is why the capture has to happen where weight is genuinely defined as zero. If the number on the panel still disagrees with your hand calculation after a correct two-point run, why the scale value differs from the PLC analog input walks through the mismatches that produce it.
When should the logic capture the tare?
Capture the tare once, at the qualified empty point: the sequence at its empty step, the reading below your residual threshold, for example 5 lb, and the raw value settled, for example unchanged by more than 2 counts for 3 seconds.
Each condition has a job. The empty step ties the capture to the process, so nothing can fire it mid-batch. The residual threshold confirms the bulk of the charge has left. The settle window keeps a moving number out of the register.
The threshold and the timer qualify the sequence step. They do not prove the vessel is physically empty: powders and cement bridge and release late, so material hanging at capture can drop out afterward and drag the raw count below the register. Choose the behaviour deliberately. If the process accepts a known residual as its zero, capture on the timer and alarm on any display below 0 lb so the release stays visible. If it does not, hold the capture behind a verified-empty confirm: a purge or flush step, a level probe, or an operator acknowledgement at the panel.
Recommendation: capture on a one-shot at a verified empty point once the reading has settled, and alarm on any reading below 0 lb. If the cycle cannot wait for a verified-empty confirm, capture at the timer anyway and set the alarm limit to the residual you accept, so every late release shows up instead of hiding inside the next batch.
How do I write the tare logic step by step?
The capture is a single copy instruction on a rising edge: on the accepted empty condition, move the current raw count into the tare register once, and let the running calculation subtract that stored value on every scan.
- Confirm the raw span. From the analog input module's manual, note the count span it delivers for 0-10 V (4095 counts in the example) and the address or variable the counts land in.
- Compute the gain with the two-point method above and store it as a floating-point constant.
- Create the tare register: one retentive integer, same width and data type as the raw channel, initialized at commissioning to the current raw count.
- Build the gate: empty step active, displayed weight below the residual limit, and raw unchanged within the settle band for the settle time.
- Copy on the edge: the rising edge of the gate copies raw into the register once per cycle. No adds, no accumulate, no per-scan writes.
- Run the calculation every scan:
weight = (raw - TARE) * gain, subtracting any retained commissioning offset before the tare term if you kept one. - Add the displays and alarms: live weight on the HMI, an alarm below 0 lb, and an interlock that blocks the next charge while the display sits below zero.
What does a worked example look like with real numbers?
Take a 2000 lb hopper on a conditioner that spans 0-10 V into 4095 counts: gain 0.4884 lb per count, a 12-count electrical zero, a 1500 lb batch that should read 1500 lb, and a 5 lb residual that would read minus 4.9 lb if captured by mistake.
The load cell feeds a signal conditioner with a 0-10 V output for 0-2000 lb, and the analog input module converts 0-10 V to 0-4095 counts (a 12-bit module; use the span your own manual prints). That is 4095 / 10 = 409.5 counts per V, and the gain is 2000 / 4095 = 0.4884 lb per count.
The conditioner's electrical zero trims to 0.03 V, so a verifiably empty hopper idles at 0.03 × 409.5 = 12.3, rounded to 12 counts. At the verified empty point the gate fires and the register stores 12.
A 1500 lb charge puts the conditioner at 0.03 + (1500 / 2000 × 10) = 7.53 V, so raw = 7.53 × 409.5 = 3083 counts. The display shows (3083 - 12) × 0.4884 = 3071 × 0.4884 = 1499.9 lb. Scaling and capture both check out.
Now the wrong capture. The previous cycle ended with 5 lb of cement hung above the discharge gate. The display read 5 lb, under the threshold; the timer expired; the logic captured. Five pounds is 5 / 0.4884 = 10 counts, so the register stored 12 + 10 = 22. The next cycle discharges completely and the stuck material drops with it. Raw returns to 12 on a verifiably empty hopper, and the display shows (12 - 22) × 0.4884 = -10 × 0.4884 = -4.9 lb.
The error equals the residual one for one: 5 lb captured, 4.9 lb below zero. That is the whole failure mode, and it is why the capture point is the decision that matters.
Why does the weight read negative after the hopper fully empties?
A negative weight means the live raw count has dropped below the stored tare, which is what happens when the register was captured with material still hung up and that material releases later; in the example above the display lands 4.9 lb below zero.
A tare moves the zero line and changes nothing about the slope. Every pound on the vessel at capture is a pound the display reports below zero once it leaves, because with a positive gain, raw above the register reads positive and raw below it reads negative. Decide per case:
- Residual defined as zero: the negative reading is expected and correct. The alarm at 0 lb makes it visible, and the charge interlock holds the next batch until the display climbs back through zero.
- Residual never accepted: hold the capture behind the verified-empty confirm and the case never arises.
- Negative with a verifiably empty vessel and no recent capture: the register is not the cause. That is a signal fault, and the last section below takes it in order.
To show sub-zero values cleanly on the panel, scaling negative analog values on an HMI panel covers the sign handling.
How do I check the tare before returning the line to service?
Check three points before the line runs: the display reads 0 lb at the qualified empty point, a known 1500 lb batch reads within your process tolerance, and the reading returns to 0 lb, not below it, after the batch discharges.
- Zero check. At the qualified empty point, record the raw count, the register and the display. The display should read 0.0 lb, because the register equals the live raw by construction. Write the raw value down; it is the baseline for the next cycle.
- Span check. Charge a known batch or hang a known test weight. If your recipe batches to ±1%, a 1500 lb charge must land between 1485 and 1515 lb. A passing zero with a failing span points at the gain, the count span from the manual, or the conditioner.
- Return check. After discharge and the settle window, the display should hold at 0 lb, or at the accepted residual below it, and stay there.
- Late-release check. Force or wait for the case where material hangs past the timer. The alarm at 0 lb should fire, and the charge interlock should hold the next batch until the display recovers.
When should I stop retaring and chase the fault instead?
Stop retaring when the raw input will not settle, when the vessel's empty state is not defined for the cycle, or when the reading sits negative after the hopper verifiably empties: those are signal-path or mechanical faults, and a tare hides them.
A raw input that keeps moving with no load change points at the signal base: terminations, shielding, the channel itself. Erratic analog input readings works through that path in order. A negative that survives a verified empty vessel with no fresh capture means the raw drifted under a stale register, the same fault in slower motion. A register that needs updating every single cycle, by more than the residual you defined, is a baseline that is walking, which points at conditioner or module drift.
Fix the cause. A tare zeroes a display, and it does nothing for a drifting load cell, a conditioner losing its trim or a discharge gate that hangs material up every cycle. When this weight feeds a charge quantity or an overload interlock, treat a persistent offset as a stop-and-fix condition, not a number to trim away at the next cycle.
Questions
Can I trim the conditioner's zero screw instead of taring in logic?
The zero trim sets the conditioner's electrical output with no load applied, and it is the right tool for a permanent offset at commissioning. It cannot follow a per-cycle condition: a trim set while material hangs in the vessel is wrong the moment that material drops. Trim once at a verified empty vessel, then let the logic tare absorb the small offset that remains cycle to cycle.
What data type should the tare register use?
Use the same integer type as the raw channel, wide enough for the full count span with its sign. Keep the subtraction in counts and multiply by the gain once: (raw minus TARE) is an exact integer difference, and one floating-point multiply leaves a single rounding step. Scaling each value to pounds before subtracting puts two roundings into every displayed weight.
Should I add the new reading to the old offset?
No. Adding the live reading on top of an existing offset applies the same correction twice and shifts zero by the full residual every time it runs. Store one snapshot per capture in its own register. If you kept a fixed commissioning offset, subtract it first and apply the tare to that result, once per cycle.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.