Explainer
Why a legacy serial PLC needs a gateway for Modbus RTU
Short answer
A legacy serial PLC such as an Omron CPM2A or CPM2C only answers host link commands on its built-in port, so it cannot originate Modbus RTU requests. Fit a protocol gateway that terminates host link and polls the slave itself, or build the frames in ladder, and commission one readable register before any write.

On this page
- The built-in port answers host link; it never asks
- Why an electrical converter is not the fix
- What a protocol gateway does
- When building the frames in ladder makes sense
- Enter the offset, not the display number
- Sizing the poll: five slaves of four registers each at 9600 baud
- Commissioning order that finds faults cheaply
- The decision for each case
- Questions asked
An Omron CPM2A- or CPM2C-class PLC cannot talk to a Modbus RTU slave directly: its built-in serial port only answers host link commands and never originates a request of its own. Two fixes exist. Fit a protocol gateway that terminates host link on the PLC side and runs its own Modbus RTU master toward the field unit, or write a ladder program that builds the Modbus frames byte by byte. The gateway is the right answer for almost every job. This article gives the role test that proves why, the register-offset rule that trips most first commissioning attempts, and the poll-time arithmetic that decides whether your update rate fits the port.
The built-in port answers host link; it never asks #
On the CPM compact family the serial port runs host link: the attached device — a programming tool, an HMI, or a gateway — is the master that issues read and write commands against the PLC's data areas, and the PLC only answers. Each PLC on a host-link multidrop carries its own unit number, and such a network supports up to 32 stations. A Modbus RTU master is the opposite role: it originates every transaction on the wire. A port that only answers has no mechanism to begin a Modbus request, so no change of baud rate or framing turns the PLC into a master. The role mismatch, not the wiring, is why the direct connection fails.
Why an electrical converter is not the fix #
An RS-232-to-RS-485 converter changes voltage levels and nothing else. The PLC still transmits host link, the field unit still expects Modbus RTU, and neither side decodes the other's frames. Electrical compatibility is a prerequisite for a working link, never a translation of the application protocol. If the box you are holding only converts levels, it is the wrong box for this job, whatever its datasheet implies about the connectors it fits.
What a protocol gateway does #
A protocol gateway is a translator with two independent serial personalities. Toward the PLC it acts as the host-link master, calling the PLC by its unit number and reading or writing the mapped data areas. It keeps the exchanged values in an internal map. Toward the field unit it acts as a Modbus RTU master that polls the slave on its own schedule, with no involvement from the PLC program. The PLC simply sees its data areas change as the gateway works.
Because the two sides run independently, you commission and fault-find them separately. Match and test each side before trusting the map:
| Side | Settings to match | Test before moving on |
|---|---|---|
| PLC, host link | Baud rate, frame format, and the unit number the gateway calls | The gateway reports valid PLC-side exchanges with no framing or timeout errors |
| Field, Modbus RTU | RTU or ASCII, baud rate, parity, data and stop bits, slave address | A first read of one register returns a valid response |
| Data map | Function code, raw address, quantity, direction, PLC destination | The value lands in the mapped PLC area and tracks the field unit |
What a gateway can and cannot carry across is the same question whether the PLC side speaks host link or DF1, and What a gateway can map from DF1 serial to Modbus TCP works through that mapping boundary function by function.
If the conversion needs logic a fixed gateway cannot express — conditional reads, calculations between the two sides, or a second protocol on top — a compact computer beside the controller takes over the same job: an industrial mini PC can run the converter as host-link master on one serial side and Modbus RTU master on the other.
When building the frames in ladder makes sense #
The CPM2 can be programmed as a Modbus RTU master in ladder, and Writing a Modbus RTU master on an Omron CPM2 in ladder shows the working approach on that exact CPU. You take ownership of the whole transaction: CRC generation, the silent interval that delimits RTU frames, timeouts, retries, and response validation. That is a fair trade for one or two registers polled at a fixed rate and no other traffic on the port. It stops being a fair trade as the point count, the write traffic, or the mix of slaves grows. Note that writes in any implementation must go out as complete, well-formed request frames — the failure mode where a partial write silences the slave is covered in Modbus RTU Coil Writes Require Complete Request Frames.
Enter the offset, not the display number #
Slave manuals print holding registers as 40001-style display references. The frames on the wire carry raw offsets: for holding registers, raw offset equals the display reference minus 40001, so 40001 maps to offset 0 and 40101 maps to offset 100. Enter the display number where the gateway expects the offset and the slave answers with Modbus exception code 02, illegal data address, and your map stays empty. The same display-versus-offset confusion behind why Modbus error 8189 needs 400001 added to the register address applies here. Record both numbers for every mapped item — the reference as the slave manual prints it and the raw offset the gateway wants — and prove one read works before you configure anything else.
Sizing the poll: five slaves of four registers each at 9600 baud #
This example decides whether a planned poll cycle fits a small serial port. The inputs:
- Five field slaves, four holding registers each: an example layout for a small cell of drives and sensors.
- 9600 baud, 8 data bits, even parity, 1 stop bit: the example's port settings; read the real values off your slave's configuration and substitute them.
- 11 bits per RTU character (1 start, 8 data, parity, 1 stop): Modbus RTU framing.
- A 3.5-character silent interval before the request and after the response: also Modbus RTU framing.
- Request frame of 8 bytes and response frame of 13 bytes: the fixed structure of function code 03 reading 4 registers — address, function, 2-byte start, 2-byte quantity, 2-byte CRC going out; address, function, byte count, 8 data bytes, CRC coming back.
- A 100 ms freshness target: this example's process requirement for the mapped values.
The rule in words: wire time per poll equals the total frame bytes times the character time, plus 7 characters of silence, where the character time is 11 bits divided by the baud rate.
The arithmetic: at 9600 baud the character time is 11 / 9600 = 1.146 ms. One poll costs (8 + 13) × 1.146 ms + (2 × 3.5) × 1.146 ms = 28 × 1.146 ms = 32.1 ms on the wire. Polling five slaves in turn costs 5 × 32.1 ms = 160.5 ms per full cycle.
The result: 160.5 ms of wire time alone already exceeds the 100 ms target before the slave's own response delay is added, and that delay is device-specific — commissioning measures it on the first exchange, but no value it can take rescues this cycle.
The decision: five four-register polls at 9600 baud do not meet a 100 ms cycle, so move the port to 19200 baud. The character time halves to 0.573 ms, each poll drops to 28 × 0.573 ms = 16.0 ms, and the five-slave cycle becomes 80.3 ms, which fits with margin for the turnaround and the PLC-side host-link exchange. If you must stay at 9600 baud, cut registers per poll instead: every data byte dropped saves 1.146 ms per slave in each direction.
Commissioning order that finds faults cheaply #
Bring up one readable value first. Pick a register whose value you can change or independently observe at the field unit, map only that item, and confirm the value arrives in the assigned PLC word and tracks the field unit. Check its data age, not just its presence. Add one nonhazardous write only after that read is proven, and issue it with the controlled equipment in a safe state so a wrong frame cannot move anything. Then expand the map in small groups, and after each group confirm response health, PLC-side behavior, and the age of every mapped value.
The decision for each case #
- Legacy CPM2A- or CPM2C-class PLC, more than a couple of points, any writes, or a shared port: fit a protocol gateway. It removes the frame-building risk and lets the PLC program stay logic-only.
- One or two registers, a fixed poll rate, no other traffic: the ladder master is defensible if you accept owning CRC, frame timing and retry code for the life of the machine; the gateway still costs less engineering time overall.
- Only a level converter between the PLC and the slave: never — it cannot translate host link into Modbus RTU.
- The five-slave, four-register example at a 100 ms target: reconfigure the port to 19200 baud, which brings the cycle to about 80 ms of wire time, or reduce the registers per poll.
- Before ordering any gateway: confirm in writing that it supports the host-link protocol on the PLC side and the slave's exact Modbus transport and electrical interface.
One commissioning rule covers the whole job: prove one readable register end to end before you configure a single write, because every later fault isolates faster against a known-good read.
Questions asked
Can I put the PLC on the Modbus RTU network with just an RS-232 to RS-485 converter?
No. A converter matches electrical levels only. The PLC still transmits host link and the slave still expects Modbus RTU, so neither side decodes the other. You need protocol translation: a gateway that speaks host link toward the PLC and Modbus RTU toward the field, or a PLC program that constructs the Modbus frames itself.
What raw address do I enter in the gateway for holding register 40001?
Subtract 40001 from the display reference: 40001 gives raw offset 0 and 40101 gives 100. Gateways and most Modbus masters expect that raw offset on the wire. If you enter the display number instead, the slave answers with Modbus exception code 02, illegal data address, and the map stays empty.
How fresh is the data the PLC actually sees?
The 32 ms poll time in the worked example is wire time on the Modbus side only. Total data age adds the gateway's host-link exchange with the PLC, its map update, and the slave's own response delay, and those figures depend on the specific gateway model and serial settings. Measure end to end at the first register: change the field value, watch the mapped PLC word follow, and confirm the age stays inside your process requirement.
Do the PLC and gateway serial settings need to match, and where do I find them?
Yes. The gateway's PLC-side port must use the same baud rate, data bits, parity, stop bits and framing as the PLC's serial port, and it must call the PLC by its configured unit number. Host-link port defaults differ between models and port types, so take the values from the settings of the exact PLC you are wiring to, not from another model's documentation.


