Selection guide
Selecting a Modbus TCP analog output module for 4-20 mA
Short answer
Choose a fixed-conversion Modbus TCP remote module with two analog outputs when your client can scale into the raw 0-4000 count register and write it with function 06 or 16; step up to a small programmable controller with a 4-20 mA analog output expansion only when the remote device must convert a custom register range to current itself.

On this page
Pick a Modbus TCP analog output module by one question: where does the loop-current scaling run? If your client can convert engineering values into raw counts and write them into the module's output registers, a fixed-conversion remote I/O module with two analog outputs does the job — you write with function 06 or 16 and the module applies its documented conversion. Step up to a small programmable controller with a 4-20 mA analog output expansion only when the remote device itself must take a custom register range and turn it into current. Output count, register addresses and function codes all follow from that choice, and the worked example below puts numbers on it.
The decision rule: where the scaling runs #
The fixed branch runs the conversion inside the module. The register map this decision rests on documents two current outputs as output-value registers 40017 and 40018, raw values from 0 to 4000 into the documented current range, and Modbus functions 03, 04, 06 and 16. When your client can do that linear scaling — the same conversion PLC analog input and output modules apply to signals, just placed on the far side of the network — the module asks nothing more of the selection.
When the requirement is that the device itself reinterpret the register range — a custom span, local limiting, a value that must stay meaningful after a client swap — the conversion has to run as code at the device, and that code needs a programmable controller. A fixed map is not writable; it is part of the module.
The two branches, compared #
Three points separate the branches: output count, who converts, and what the client writes.
| Selection point | Fixed-conversion remote module | Programmable controller with output expansion |
|---|---|---|
| Analog outputs | Two current outputs | Four channels, documented as 4-20 mA |
| Conversion | Fixed map: 0-4000 counts to the configured current range | Your program, at the device |
| Client writes | Raw counts to the two output-value registers | Whatever range your program defines |
| Function codes | 06 or 16 to write, 03 to read back | Standard server registers you map |
| Best fit | Client scales; documented endpoints acceptable | Device must interpret the register range |
Write the output value with function 06 or 16 #
Function 06, Write Single Register, writes one holding register; function 16, Write Multiple Registers, writes a block, which suits a two-output update in one transaction; function 03 reads holding registers back for verification. Watch the address convention: 40017 in five-digit notation means register 17, protocol offset 16, so a client configured for zero-based offsets takes 16 — enter 40017 there and the write lands one register away from the output. The relation between the number on a register list and the address a client sends is what What CODESYS %IW0 means for a Modbus TCP holding register walks through.
A write acceptance or a matching readback proves the register, not the current: an open circuit or an overloaded output holds the loop at zero with communications healthy — the same failure that leaves a valve actuator still on a correct PLC analog output. When the writes come from a supervisory client instead of your own program, the interlocks in safe Modbus writes to PLC output registers from SCADA keep a stale value from moving a live output.
Worked example: commanding 12.5 mA at output 1 #
Inputs, with their sources:
- Command: 12.5 mA at output 1 — the example setpoint.
- Map: 0 to 4000 counts, taken from the module's documented output-value register for output 1.
- Mode: the current mode with the 4 mA live zero, selected in the module's output configuration; the mode decides which currents the two endpoints span.
The rule in words: with 4 mA at count 0 and 20 mA at count 4000, the span is 16 mA and the count rises 250 counts per 1 mA of command, so count = 4000 × (12.5 − 4) ÷ 16 = 34000 ÷ 16 = 2125.
The result: write decimal 2125 to holding register 40017 with function 06, and a function 03 read of the same reference must return 2125. Then measure the channel once at commissioning: de-energize the loop, put the meter in series, and re-power the output.
The decision: a meter reading 12.5 mA proves the path end to end. A reading near 10.6 mA means the module is running the zero-based mode against your counts — 2125 counts span differently in the two modes, and the same command needs 2500 counts there. Confirm the mode in the output configuration before redoing any math.
When the programmable branch is the answer #
Take it when the register value must be interpreted at the device: a custom input span, a non-linear curve, local limiting, or a range that survives replacing the client without rewriting the client. The pattern is a small programmable controller with an analog output expansion of four current channels; its Modbus TCP server holds the registers your program defines, and the program runs the same linear conversion the client would have run, with span, offset and clamps under your control at the device. Only code at the device meets the requirement that the module calibrate its output range from the register value.
The decision for each case #
- The client can scale, two current outputs, the documented endpoints are acceptable: take the fixed-conversion remote module. Write counts to the two output-value registers with function 06 per channel or 16 for both, verify with 03, and measure each channel once at commissioning.
- The device must convert a custom register range to current itself: take the small programmable controller with the four-channel analog output expansion and put the conversion in your program at the device.
Questions asked
Does either branch give a native 0-10 mA output?
The documentation behind this decision lists 0-20 mA and 4-20 mA modes on the fixed module's raw count map, and 4-20 mA on the programmable branch's expansion. A native 0-10 mA mode appears in neither list. Treat that range as a specification to verify against the output-mode documentation of the exact module before you buy, or produce it with a signal converter in the loop.
What does a function 06 response confirm?
A function 06 response echoes the register address and the value from the request, so a match confirms the server accepted the write into that register. It confirms nothing about the current at the terminals. Complete the check with a function 03 read of the same reference and a series meter reading at the loop; when write, readback and measurement all agree, the output path is proven.
Can one transaction update both analog outputs?
Yes. Each output takes one 16-bit holding register, 40017 and 40018 in the documented map, and a function 16 request whose first reference is 40017 with a register count of two updates both channels together. Keep the channel order exactly as the register map lists it: the first register after the beginning reference drives output 1. When only one channel changes, function 06 remains the cleaner choice.
