How-to
Scaling Analog Inputs for Both PID and HMI Display in Ladder
Short answer
Configure the 1769 analog channel for engineering units X1 across the transmitter span, set the CompactLogix PID scaling to the same range, and display that one tag on the PanelView Plus. Decimal-place settings change appearance only; add a single CPT rate-and-offset rung only when a consumer needs different units.
On this page
Put the conversion in one place and feed every consumer from it. Configure the 1769 analog input channel for engineering units X1 across the transmitter span, set the PID's PV scaling to that same range, and point the PanelView Plus display at the same tag — that combination needs no ladder math at all. Decimal places on the display are formatting, not scaling. When a consumer genuinely needs different units — tenths out of an X10 channel, or engineering units out of a percent-range channel — add exactly one CPT rung with the rate-and-offset formula below, and never scale the same signal twice.
One canonical process variable #
A CompactLogix analog input channel delivers the representation you configure, not raw bits. The 1769 analog module documentation (the Compact I/O Analog Modules User Manual, publication 1769-um002, for the classic modules) lists the channel data formats: engineering units, scaled-for-PID, and percent of range, with engineering units offered X1 and X10. Downstream, the PID instruction has its own PV limits, and the PanelView Plus numeric display has its own decimal setting. Three knobs, one signal — the classic failure is turning two of them and assuming the third follows.
The symptoms are recognizable on sight. A display reading ten times the field instrument is an X10 tag being treated as X1. A display that looks right while the loop swings is a PID consuming different units than the operator sees. And because Studio 5000 Logix Designer ladder has no scale-with-parameters instruction, the conversion tool left to a ladder-only program is the CPT instruction.
The configuration that needs no ladder math #
- In the module properties, set each channel's data format to engineering units and enter the transmitter's live range as the scaling limits — a 4-20 mA transmitter spanning 0 to 150 °C then delivers 0 to 150 at the channel tag.
- In the PID instruction's scaling, give the PV limits in unscaled analog units as 0 and 150 and in engineering units as 0.0 and 150.0. The instruction's internal conversion is then one-to-one, and the setpoint is entered directly in °C.
- Point the HMI numeric display at that tag with zero decimal places. X1 moves in whole-unit steps, so the format hides nothing.
- If the process needs tenths, set the channel to engineering units X10 — ten counts for every unit, 0 to 1500 for the same transmitter — give the PID the unscaled limits 0 to 1500 against engineering limits 0.0 to 150.0, and display the loop's scaled PV instead of the channel tag.
- Repeat per channel. Four loops means four channel configurations and, at most, four conversion rungs, each carrying that channel's own numbers.
The one CPT rung when the units differ #
The conversion is one linear equation built from four documented endpoints — the range the channel is configured to deliver, and the range you want:
Rate = (ScaledMax - ScaledMin) / (InputMax - InputMin)
Offset = ScaledMin - (InputMin * Rate)
ScaledValue = (InputValue * Rate) + Offset
Worked example, illustrative numbers: a 4-20 mA level transmitter spans 20.0 to 300.0 cm, and the channel is kept in a site format that delivers 0 at 4 mA and 1000 at 20 mA.
- Rate = (300.0 cm - 20.0 cm) / (1000 - 0) = 280.0 / 1000 = 0.28 cm per count
- Offset = 20.0 cm - (0 × 0.28 cm per count) = 20.0 cm
- One CPT rung: destination
Level_PV_cm(REAL), expression(Ch0_Raw * 0.28) + 20.0, whereCh0_Raw(REAL) holds the channel's 0 to 1000. If the site prefers readable constants, hold them as REAL tagsLevel_Rate = 0.28andLevel_Offset = 20.0.
Test that proves it — force Ch0_Raw and read Level_PV_cm:
| Ch0_Raw forced | Arithmetic | Result |
|---|---|---|
| 0 (4 mA) | (0 × 0.28) + 20.0 | 20.0 cm |
| 250 (8 mA, quarter span) | 250 × 0.28 = 70.0; 70.0 + 20.0 | 90.0 cm |
| 1000 (20 mA) | 1000 × 0.28 = 280.0; 280.0 + 20.0 | 300.0 cm |
The midpoint cross-checks against the span: 20.0 cm + 0.250 × 280.0 cm = 90.0 cm. For an X10 channel the same formula collapses to Rate 0.1 unit for each count and Offset 0.0 — a pure divide by ten. The method itself is not platform-specific; it is the same arithmetic used for scaling a 4-20 mA analog input to engineering units in CPM2 ladder. To keep four channels consistent, wrap the rung and its two constants in an add-on instruction so every loop scales the same way.
PID settings that must agree with those units #
The scaling carries the output side as well. With a 1769-OF4 output channel in Percent Range, set CV 0% Engineering Units to 0 and the 100% value to 10000, which is the count range that format expects from a 0-100 % output.
Run each PID in a periodic task and set its loop update time .UPD equal to the task rate, so the integral and derivative terms act on the time base they were configured for.
A PIDE in a single function-block routine — everything else done from ladder, writing the instruction's tag elements — is the upgrade path if the end user ever accepts one FB routine on the site. The ladder PID above needs nothing else to run these loops.
Decimal places are formatting, not scaling #
The numeric display's decimal setting rounds what the operator sees and never touches the controller value. Zero decimals on a stored 75 reads 75; one decimal on an X1 tag reads 75.0 forever, because the source never produces tenths. When the display is off by exactly ten, fix the representation or add the one conversion — do not divide in the display.
A wrong-looking value can also come from how the panel handles a float rather than from scale; fixing a PanelView float display that shows the wrong value covers that case. And if you do point a display at a raw integer channel, the tag-level math is the same as when you scale a PLC integer into an HMI display value.
Verify both endpoints before the loop runs #
Drive each channel to 4.0 mA and 20.0 mA with a signal source and read three places: the channel tag, the PID's scaled PV, and the PanelView Plus display. All three must agree at both endpoints — 20.0 cm and 300.0 cm in the worked example — and at one interior point, 90.0 cm at quarter span.
An error that is constant across the span is the offset; an error that grows with the span is the rate or an X1-versus-X10 misread. Never tune the PID to absorb a scaling error. Until the endpoints agree, keep the output in manual or a safe state: a PV with the wrong span steers the loop the wrong direction.
Questions asked
Does setting zero decimal places on the HMI change the process variable?
No. The decimal setting on a numeric display changes only what the operator sees; the value in the controller is untouched. With the channel in engineering units X1 the stored number already moves in whole-unit steps, so zero decimals hides nothing. Tenths require the X10 format, which puts ten counts for every unit and needs one divide-by-ten conversion.
Is scaled-for-PID a better card format for four loops?
It is a good fit when the loop is the only consumer: enter the scaled-for-PID range as the PV limits in unscaled units and the transmitter range as the engineering-unit limits, then display the loop's scaled PV rather than the channel tag. Engineering units at the channel still wins when other logic also reads the signal, because everyone shares one canonical value.
Why does the display read ten times the expected value?
An engineering-units X10 tag is being read as X1. Fix it at the source: pick one representation and convert once, on the PID scaling for the loop or with the single CPT rung for everything else, rather than dividing in the display. An exact factor of ten between two readings is the signature of this mix-up.
Can the PID's PV limits do the whole conversion?
They carry the loop only. The scaling performs one linear mapping from what arrives at the PV input to engineering units, so the setpoint and the tuning act on real units. They do not convert the channel tag for the HMI or for other logic; that is exactly the job of the one CPT rung.
Do I need function block for these four loops?
No. The ladder PID with its scaling, plus at most one CPT rung per channel, runs all four loops in a single ladder routine. A PIDE in one function-block routine, with control written from ladder through its tag elements, is worth proposing only if the end user later accepts a function-block routine on the site.