Leave the touchscreen's polling rate and the PLC scan alone. Sample the scaled temperature every 100 ms, average 10 samples into a separate register, and point the screen at that register: the reading steps about once per second and the animation keeps its pace. Fix wiring and scaling first, because a filter only hides scatter.
Slow the number in the PLC and leave the touchscreen alone. The polling rate is what keeps the screen's animation smooth; stretching it to calm one temperature trades a steady number for choppy graphics. Sample the scaled temperature every 100 ms, average 10 samples into a separate display register, and point the numeric object at that register. The reading steps about once per second, the animation keeps its pace, and the raw register stays free for diagnosis. A filter only hides scatter: an input type set wrong, a scaling error, or a loose signal wire has to be fixed at the source, so first work out which of those you have.
What the jumping tells you
The symptom narrows the cause before you touch anything:
- Jumpy in the Data View and on the screen. The signal or input side is noisy. Check the sensor loop, its shielding, and how the input card sits on its base, the sequence in erratic analog input readings.
- Steady in the Data View, jumpy on the screen. The tag the screen reads, its format, or its scaling is at fault; the input is fine. The same mismatch appears when the scale value differs from the PLC analog input.
- The reading halves when you change one constant in the math. A register inside the expression holds 0 and nothing writes it. The divisor arithmetic is in the next two sections.
- The last digit flickers a few tenths while the process sits still. Random noise. A 10-sample average cuts that flicker to about a third.
- The value steps one way, or walks off over minutes. Real process movement or sensor drift. A filter would hide it; find the cause.
Check the input before you add math
An analog channel on this class of compact input converts in about 50 ms, so the card delivers at most 20 fresh values per second (1000 ms / 50 ms = 20). Sampling faster than that reads the same conversion twice.
The tempting shortcut is reading the input every fifth scan. With a 5 ms scan that is one read every 25 ms, 40 reads per second (1000 / 25 = 40). Half of those 40 reads repeat a value the card already delivered, and no screen shows 40 changes a second, so the display stays jumpy.
Set the sample interval from the conversion time. 100 ms is twice the 50 ms conversion, so every sample is fresh, and it matches how fast a temperature process moves. Your module manual prints the conversion time for the exact card; a card converting in 25 ms supports a 50 ms sample interval on the same two-to-one rule.
Check the filter setting that is already there
The help in the CLICK programming software has an 'analog filtering' topic, and a project may already carry a filter. In the example filter for this controller, a 0 in DS1 provides no filtering at all, so a project can look configured while running raw. Read that setting before adding your own math.
Then trace any register you plan to tune. A setting register that holds 0 and never gets written explains both odd results in one line of arithmetic: a divisor of (0 + 1) divides by 1 and passes the value through unchanged, and (0 + 2) divides by 2 and halves the reading. Pick registers the project map shows as free and the screen does not touch for page changes, write a known value into the setting with a constant or an instruction, and confirm it in the Data View before the math runs.
Write the block average
A block average accumulates samples, then publishes once per block. It is fewer rungs than a rolling average, and a once-per-second update suits a temperature an operator reads.
- Choose three registers the project does not use: a floating-point running sum (the CLICK handles analog data as floating-point values in DF registers), a sample counter, and a display register for the result.
- Add a self-resetting timer with a 100 ms preset. Its done bit is the sample contact: it fires once every 100 ms.
- On each sample, add the scaled temperature to the sum and add 1 to the counter.
- When the counter reaches 10, divide the sum by 10 with floating-point math, move the result to the display register, then write 0 to the sum and the counter.
- Clear the sum and the counter on the first scan so the first block starts from zero.
- Point the screen's numeric object at the display register. Leave the polling rate and the scan time alone.
If the readings come from a scale and single spikes are the real problem, drop the highest and lowest before averaging, the way averaging eight scale readings in PLC logic does. If you want a value that updates on every sample, a FIFO of registers gives a rolling average at the cost of one register per sample plus the shifting to fill it, the same structure as keeping a sensor trace in a block of PLC integers.
Example: steadying one transmitter reading
Example: a 4 to 20 mA transmitter spans 0 to 100.0 °C, and the scaled register flickers between 72.4 and 74.1 °C on a steady tank. The filter samples every 100 ms and collects, in °C: 73.2, 73.8, 74.1, 73.5, 73.9, 73.1, 72.8, 73.6, 74.0, 73.4.
Sum: 73.2 + 73.8 + 74.1 + 73.5 + 73.9 + 73.1 + 72.8 + 73.6 + 74.0 + 73.4 = 735.4 °C Average: 735.4 / 10 = 73.54 °C, shown as 73.5 °C
The display now shows one 73.5 °C per second in place of tenth-degree flicker. The random part falls by the square root of the count, the standard error of the mean: √10 is about 3.2, so the flicker drops to roughly a third of the raw scatter. The offset stays put: averaging narrows scatter, and a fixed error passes straight through. When the tank truly moves to 80.0 °C, the first completed block lands partway and the second lands on 80.0 °C, so the step reads fully between 1.0 and 2.0 s after it starts.
Choose the block length
All rows assume the 100 ms sample interval.
| Samples per block | Display updates every | Reading trails the process by about |
|---|---|---|
| 3 | 0.3 s | 0.15 s |
| 8 | 0.8 s | 0.4 s |
| 10 | 1.0 s | 0.5 s |
| 25 | 2.5 s | 1.3 s |
Three samples keep the number close to live for values an operator acts on. Ten is the general-purpose choice for a watched temperature. Twenty-five fits a value people glance at, where a 2.5 s update reads calmer and nobody chases it. Counts of 3, 8, 16 and 25 cover the usual range; 10 gives a round 1.0 s block.
Keep the filtered value on the display path
Three registers, three jobs: the raw input for diagnosis, the scaled engineering value for alarms and control, the filtered register for what people read. Keep alarm comparisons on the scaled value: a 10-sample block trails the process by about 0.5 s, and a fast excursion deserves the freshest number the card delivers. A delay belongs in a trip path only when the control design puts it there on paper.
If the same temperature feeds a trend chart, set its sample interval from the same conversion time, the way fitting a multi-hour temperature trend on an HMI sets it from the window length. A first-order filter is the other common route: it folds each new sample into the running result and moves on every sample, and the numbers in a moving average versus low-pass filter comparison for a slow process signal carry over to any PLC.
The decision
Recommendation: sample the scaled temperature every 100 ms, average 10 samples in a block, and point the screen at the filtered register; leave the polling rate and the scan time as they are. The display steps about once per second and the animation keeps its pace. Use 3 samples where the operator acts on the number quickly, and 25 for a value that is only glanced at. Keep alarms and control on the unfiltered scaled value, and clear the wiring and scaling questions in the first two checks before you trust any filter.
Questions
Should I average the raw counts or the scaled temperature?
With a linear scale the order gives the same answer to rounding, so you can scale first and sum in engineering units. Do the sum in floating point after scaling, because that is the number you can check against a handheld meter. If the conversion is piecewise, for example a tank strapping table, average after the conversion to real units.
Does a bigger block always give a steadier number?
The random part shrinks with the square root of the count. Going from 10 samples to 40 at 100 ms cuts the flicker from about a third to about a sixth of the raw scatter, while the trail grows from about 0.5 s to about 4.0 s and the display updates only every 4 s. Past 10 or 25 samples you are buying calm with delay, and what remains is usually real process change.
Can I use the built-in analog filtering and my own average together?
You can, and the delays stack. In the example filter for this controller, a 0 in DS1 provides no filtering at all, so first read what the project actually has set. Two filters in series each add their own lag, so set one of them. Prefer your own block average when you want to see and set the sample count and interval yourself.
The display alternates between two values tens of degrees apart. Will a filter fix it?
No. Alternating between two distant values is a discrete fault: a loose signal wire, a broken shield, or two grounds fighting through the sensor loop. A 10-sample average of such readings lands between the two values and misreports on every update. Fix the wiring first; a filter is for scatter of a few tenths, the size random noise makes.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.