Keep the operator's setpoint in PSI in a dedicated register, clamp it to the process span and scale it to the output module's documented raw counts in the PLC, then prove the three span points at the loop before returning it to control.
The dependable path from an operator's keypad to an analog output runs through two values kept apart: the setpoint in engineering units in a register only the operator writes, and the raw counts in the output channel that only the PLC writes. The HMI entry object stores PSI. The PLC clamps that value to the process span, converts it to the output module's documented raw range with one linear formula, and writes the result to the channel. Then you prove the whole path at the three span points, which should measure 4, 12 and the full-span current at the loop, before the loop goes back on control. This page sets up that path in order: the register, the entry object, the clamp and scale rungs, the three-point test, and the checks that point at the right device when a number disagrees.
What you need
- The analog output module's documentation page for its configured range: signal type (voltage or current), the range itself, and the raw minimum and maximum counts the module accepts for that range. Every number in the scale rung comes from that page.
- The receiving controller's input specification: its signal type and range. The two devices must be configured for the same signal type; a correct count value cannot rescue a current loop wired to a voltage input.
- Access to the HMI project and to the PLC program.
- A meter that reads milliamps, connected at the loop test jacks or in series.
- A test window with the loop in manual, so the span points can be driven safely.
Give the setpoint its own register
Pick a register that serves only the operator's request, and keep the output image address off the screen. Keeping the command separate from the output lets the PLC validate and scale the value before any of it reaches hardware.
Configure the numeric entry object on that register, label it in PSI, and set its entry limits to the process span where the object supports limits. The entry limits are the first filter; setpoint entry limits configured on the HMI shows how to make the object itself refuse out-of-span values. The PLC clamp comes later as the second filter, so a value that arrives by any other write path still gets held.
Test the write path before touching the scale: watch the register while you type a value on the keypad, the same check operator panel link setup: test writes before motion runs before machinery moves. If the register takes the value and holds it, the write path works. If it changes briefly and reverts, another rung or screen object writes the same register, and that writer has to be found before the scale will mean anything.
Clamp and scale in the PLC
Two rungs do the conversion. The clamp holds the setpoint inside the span: below 0 becomes 0, above the span top it holds the span top. Clamping HMI numeric entry limits in PLC ladder logic builds that rung step by step. The scale rung then converts the clamped PSI to raw counts:
counts = RawMin + (PSI / span) x (RawMax - RawMin)
RawMin and RawMax are the documented count endpoints for the module's configured range, and span is the process span in PSI. Keep both rungs in the PLC even with entry limits on the object: the clamp has to hold for a value that arrives without the keypad.
Use one numeric type from register to output and let the PLC's documented rounding apply once. A mid-span entry produces a half-count result in some integer widths, and one rounding at the end is easier to predict than rounding in two places.
Example: scaling a 0-200 PSI setpoint into a 4-20 mA output
Inputs, and where each comes from:
- Process span 0 to 200 PSI: the scale this loop is built to, 0 PSI at loop zero and 200 PSI at full span.
- Output signal 4-20 mA: the current span the module is configured for and the receiver expects, a 16 mA span above the 4 mA zero.
- Raw range 0 to 27648 counts: the documented nominal span several 16-bit analog module families use for a configured current range. The module manual prints its own endpoints; this example uses that printed value.
- Receiver input: the current signal mapped over the same process span.
The rule in words: counts = 0 + (PSI / 200) x (27648 - 0), after the clamp.
The arithmetic:
- Scale factor: 27648 / 200 = 138.24 counts per PSI.
- 100 PSI: 138.24 x 100 = 13824 counts. Loop current: 4 mA + (13824 / 27648) x 16 mA = 4 mA + 8 mA = 12 mA.
- 0 PSI: 0 counts, 4 mA. Full span: 27648 counts, 20 mA.
- Resolution: 200 / 27648 = 0.0072 PSI per count, so the setpoint moves in fine steps.
| Entry (PSI) | Counts at the module | Loop current |
|---|---|---|
| 0 | 0 | 4 mA |
| 100 | 13824 | 12 mA |
| 200 | 27648 | 20 mA |
The decision: at these three entries the module must hold 0, 13824 and 27648 counts and the meter must read the matching 4, 12 and full-span currents. If the counts are right and the current is wrong, the fault sits in the channel configuration, the wiring or the signal type. If the current is right and the receiver shows a different pressure, set the receiver's input to the current span over the same process range and the three points line up.
Prove the path before handback
- Put the loop in manual or the state your plant uses for a controlled output test, and note the last good setpoint. Drive a live output only when the process can accept the span points.
- Enter 0 PSI. The register reads 0, the module holds 0 counts, the meter reads 4 mA, the receiver displays 0 PSI.
- Enter 100 PSI. Register 100, counts 13824, meter 12 mA, receiver 100 PSI.
- Enter 200 PSI. Register 200, counts 27648, meter 20 mA, receiver 200 PSI.
- Try the clamp: type 250. The entry object refuses it; if a second write path puts 250 in the register anyway, the clamp rung holds the counts at 27648.
- Restore the noted setpoint and return the loop to automatic.
If a check fails
Work the list in order; each symptom points at one device:
- The register never takes the typed value: the write path. Check the object's register address, the communications status, and whether a rung overwrites the register every scan.
- The register takes the value but the counts stay put: the scale rung is not executing, or it reads a different register than the entry writes.
- The counts are right and the current is wrong: channel configuration, wiring or signal type.
- The current is wrong by a constant factor, such as ten times or half: the span endpoints in the scale rung are swapped, doubled or omitted. The value ten times too small is the most common shape of that error.
- The current is right and the receiver is wrong: the receiver's input range; set it to match the current span.
- The output sits at one value no matter the entry: the channel or the module, and the stuck analog output checklist works through it.
- 0 PSI reads a fixed amount above 4 mA: an offset left in the endpoints, and removing an offset using PLC raw counts clears it.
Recommendation
Recommendation: keep the conversion in the PLC and the operator's value in PSI for any linear setpoint driving a linear analog output. Set the entry object's limits to the process span as the first filter, keep the clamp rung as the second, and prove the three span points at the module and the receiver before the loop goes back on control. If the process variable is nonlinear against the signal, such as liquid volume against level in a shaped tank, leave that conversion out of this path and run it as its own calculation; analog scaling is linear only.
If the cell also needs a crew-facing board that shows the active setpoint and line status, that is a separate shop-floor display job; our shop-floor signage covers it.
Questions
What data type should the setpoint register use?
Match the entry object's type, the register type and the PLC logic that reads it; all three must agree. For the worked example, 13824 counts fits a 16-bit signed integer, which tops out at 32767, so an integer register carries the full span. A real register also works when the PLC math and the module accept it. Choose one type, document it in the project, and never let the entry object and the scale rung use different types.
The loop reads 12 mA but the receiver shows a different pressure. What changed?
Set the receiver's input to the current signal mapped over the same process span, so 4 mA is 0 PSI, 12 mA is the midpoint and the top of span is the full-scale pressure. The loop current and the module counts can both be correct while the receiver displays a different pressure, and the input range is the only place left to look. After re-ranging, the three test points should display 0, 100 and 200 PSI.
Can the HMI convert PSI to counts before it writes the register?
Some entry objects offer a conversion at write time, but the clamp and the module's raw range belong with the PLC logic that drives the channel. If both devices convert, the value is scaled twice and the error looks like a wrong span or a wrong zero. Give the conversion one owner; the PLC is the safer owner because it holds the clamp rung and the documented count endpoints together.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.