IMDHMIControls LibraryShop main store

Selection guide

What a PLC needs to work as a Modbus slave

Industrial networks Published 11 min read By IMDHMI controls team

Short answer

A PLC works as a Modbus slave only when its capability table documents the responding role — Modbus RTU slave on a named serial port or Modbus TCP server on Ethernet — for the exact model and firmware, on a port that stays available through operation, with a register map an external master can read. Master support proves nothing about the slave role; if the role is not documented, plan a gateway or converter instead.

On this page
  1. What does a PLC need to work as a Modbus slave?
  2. Does Modbus master support mean a PLC can also answer as a slave?
  3. Which Modbus variant does the connection need — RTU, ASCII, TCP or Plus?
  4. Can the PLC serve Modbus on a port that also does programming?
  5. How much data can one Modbus request carry?
  6. What must the slave's register map show before you buy?
  7. What RS-485 wiring does a serial slave port commit you to?
  8. When should you buy a gateway instead of native slave support?
  9. How do you prove the slave role before the purchase order?
  10. Questions asked

Buy the role, not the label. A PLC works as a Modbus slave only when the manufacturer documents the responding role — Modbus RTU slave on a named serial port or Modbus TCP server on an Ethernet interface — for the exact model and firmware you are ordering, on a port that stays available while the machine runs, with a register map an external master can read without any help from the PLC's own program. Marketing that says "Modbus support" or shows an Ethernet connector answers none of those questions, because the role that sends requests and the role that answers them are separate features. This article gives you the selection path: what the capability table must state, what one request can carry, what the map must prove, and when a converter beats a gamble.

What does a PLC need to work as a Modbus slave? #

Three documented things: the responding role for your variant — Modbus RTU slave or Modbus TCP server — stated for the exact model and firmware, a port that keeps that service while the machine runs, and a register map the requester can read without the PLC's own logic asking anything.

The place that statement lives is the communications capability table in the controller's function manual, listed per model, per option set and per firmware revision — not the family brochure. Roles get added in firmware updates and dropped in revisions, so qualify the table against the version you will actually install. The role can arrive three ways: native in the CPU, on a communications option module with its own protocol engine, or as a licensed add-in. Each is a different line on the order and a different thing to commission, so the table has to say which one you are buying.

Integration path What the documentation must state What disqualifies it
Native serial port, Modbus RTU slave Slave role named for that physical port, supported baud and parity, register map "Modbus compatible" wording that never names the slave role
Ethernet interface, Modbus TCP server Server role for that interface, port 502 service, connection count, register map Ethernet documented only for programming or web access
Communications option module Module documented as slave-capable, with its own map and a defined data exchange to the CPU Module listed only for master or protocol-conversion duty
External gateway or converter Converter that serves Modbus itself while polling the PLC over a protocol the PLC documents A tunnel-only device sold as protocol conversion

The decision rule is one line: if the responding role is not in the table for that model, that firmware and that port, treat the slave role as absent, whatever the brochure says.

Does Modbus master support mean a PLC can also answer as a slave? #

No — the master and slave functions are separate code paths, and a request your PLC sends successfully proves only that it can initiate transactions, not that it can answer them.

A master needs a request scheduler, response timeouts and a parser. A slave needs a listener parked on the port, address validation against its map, handlers for the function codes it accepts, a response builder and exception generation. Nothing in the first list produces the second, so master instructions in the instruction set are not slave access. Some vendors document the master side thoroughly and route the responding side to option hardware — what a MicroLogix 1200 needs to run as a Modbus master documents a master setup on that controller and says nothing about a slave role.

The test that separates the two: while the PLC runs its normal program, query it from an independent master. If nothing answers until the PLC's own logic has initiated a transaction first, you found a master, not a slave.

Which Modbus variant does the connection need — RTU, ASCII, TCP or Plus? #

Match the variant by exact name, because Modbus RTU, Modbus ASCII, Modbus TCP and Modbus Plus are different transports, and a controller documented for one of them is not thereby documented for any other.

Modbus RTU frames binary serial data behind a CRC and is the usual slave role on a PLC serial port. Modbus ASCII frames the same data as printable hexadecimal characters with an LRC in place of the CRC, and it needs its own line in the capability table. Modbus TCP carries the identical application messages over Ethernet, where the naming flips: the PLC is the server, the requester is the client. Modbus Plus is none of these — a proprietary peer network that shares part of the name only, and reaching serial Modbus devices from it takes a documented bridge, one more conversion boundary to commission and diagnose. Watch the converter trap too: some Ethernet-to-serial devices only tunnel serial bytes, others genuinely translate TCP transactions into RTU requests, and the device's documented operating mode is the only place the difference is written.

One behavior follows the slave role everywhere: a Modbus slave never initiates a transaction. If the machine must push an alarm, the master has to poll for it — the direction of initiative is fixed by the protocol.

Can the PLC serve Modbus on a port that also does programming? #

Only if the capability table names that physical port for the slave service and the port survives commissioning, because many serial ports double as programming ports and an Ethernet option can exist on a CPU without serving Modbus TCP on port 502.

A serial port that doubles as the programming port can be held by a PC window, an HMI pass-through or a service that grabs the line at power-up, and the slave listener loses. The comms manual's port-sharing section has to say which services run concurrently and what happens to the Modbus listener while the programming software is attached. On the Ethernet side, confirm the server service sits on the interface you will actually wire: an option module can live on the CPU, listen for its own services and still refuse the server role — why an FX3U-ENET cannot serve Modbus TCP on port 502 documents exactly that shape.

A documented server role is still not a configured one. The PLC-side settings for a Modbus TCP server are their own checklist, laid out in what you must configure on the PLC side for Modbus TCP.

How much data can one Modbus request carry? #

The application protocol caps one read response at 125 registers or 2,000 coils because the payload must fit a 253-byte message, and an individual controller or module may document a smaller maximum of its own.

Those ceilings come from the Modbus application protocol specification: every response payload has to fit the 253-byte message size, which is what sets the read maximum, and multiple writes carry their own family ceiling of 123 registers. The number that decides your design is the one printed in the device's manual, because an implementation may accept fewer than the protocol allows.

Worked example — the register set and baud rate are illustrative inputs; the message limits are the specification's. A supervisory client needs 24 holding registers from the PLC once per second over Modbus TCP. One FC03 read with start address 0 and quantity 24 returns 24 × 2 = 48 data bytes; adding the function code and byte-count fields, the message carries 1 + 1 + 48 = 50 bytes, inside the cap with room to spare, so the whole set travels in one transaction.

The same set over Modbus RTU at an illustrative 19,200 bit/s with even parity and one stop bit, 11 bits per character, moves an 8-byte request and a 53-byte response: 61 characters × 11 bits = 671 bits, and 671 ÷ 19,200 bit/s ≈ 35 ms per poll, about 3.5 percent of a one-second scan for this one slave. Multiply by every slave and every transaction per scan before you trust one serial port — how to poll many Modbus RTU slaves from one serial master works that scheduling. RTU adds one more discipline: a silent interval of at least 3.5 character times must separate frames, and a slave port that mishandles it goes quiet — why a Modbus RTU frame gap before the CRC silences the slave is that failure.

What must the slave's register map show before you buy? #

The map is part of the product: the documentation must list which holding registers, input registers, coils and discrete inputs exist, what each address holds in engineering units, and which read and write function codes reach it.

Contiguous blocks matter as much as content. A map that packs the polled values into consecutive addresses lets a single FC03 fetch everything; a scattered map forces several transactions per scan and multiplies the traffic budget from the section above. Check the function-code set the implementation actually accepts — reads (FC01, FC02, FC03, FC04), single and multiple writes (FC05, FC06, FC16) — and if your master writes bit fields through masked writes, confirm FC22 by name, because what to do when a Modbus TCP server lacks FC22 support is a real commissioning stop.

Then test the failure behavior you were never promised. A conforming slave answers a request for an undefined address with exception code 02, illegal data address, which tells the master exactly where the map ends. Slimmer implementations return zeros, stale values or nothing, and those hide the fault instead of reporting it, so probe one deliberately out-of-range address and see what comes back. Keep machine safety off this path: a Modbus map is not a validated safety channel, so any stop or guard function needs its own safety-rated means beside it.

What RS-485 wiring does a serial slave port commit you to? #

A serial slave port commits you to a two-wire half-duplex RS-485 daisy chain, termination at each cable end and one unique address in the 1-to-247 range, so the PLC's terminals and polarity must match the network you already run.

Daisy chain the trunk past every device and keep stubs short: the multidrop is one half-duplex conversation in which every slave shares the wire and only one station drives at a time. Terminate the cable at its two physical ends with a resistance matched to the cable's characteristic impedance, commonly 120 ohms, and add fail-safe bias so the idle line rests at a defined state. Terminating every device instead loads the drivers, and missing termination shows up as errors that appear only on longer runs or with particular traffic. The Modbus serial line specification carries the wiring reference and fixes the slave address space at 1 through 247, with 0 reserved for broadcast, so the PLC needs one address nobody else on the trunk holds.

Match the serial settings byte for byte: the specification's default frame is 19,200 bit/s, 8 data bits, even parity, one stop bit, with a second stop bit when parity is unused. A parity mismatch produces silence rather than an error — why a DL05 Modbus RTU slave answers only with ODD parity is that failure met in the field.

When should you buy a gateway instead of native slave support? #

Buy the converter when the responding role is missing from the capability table for your model, not after commissioning stalls: a gateway that polls the PLC over a protocol the PLC does document, and serves Modbus RTU or TCP itself, turns an undocumented controller into a documented slave.

The classic case is the legacy controller whose serial port speaks the maker's own protocol: a gateway conversion for legacy serial PLCs lets the PLC keep its native language while the network sees a Modbus slave. The same move covers a slave role that shipped only as a special module you cannot source, or a variant mismatch you cannot close inside the PLC.

Decide where the server role will live. It can be a dedicated converter, or a computer in the cabinet doing the job in software: an industrial mini PC mounted next to the controller can run the Modbus server and poll the PLC over the protocol the PLC does document. Whichever host you pick, get its freshness behavior in writing — many converters poll the controller and serve cached values, so a fast read is not a fresh read — and put a heartbeat register in the map so the master can watch for staleness. A converter stays the second choice by design, because it adds a device, a second data map and one more diagnostic boundary; when the PLC documents the role natively, buy that instead.

How do you prove the slave role before the purchase order? #

Demand one test before you sign: an independent Modbus master queries the candidate while it runs its normal program, and the PLC answers with correct values and proper exceptions without any of its own logic first sending a transaction.

Run the checks in this order and make the vendor answer each against the manual for the model and firmware on your quote:

  1. Find the responding role — Modbus RTU slave or Modbus TCP server — named for an exact port or interface in the capability table, at your firmware revision.
  2. Confirm the function codes you need, FC22 included if you write masked bit fields, and that the documented per-transaction maximum covers your largest single read.
  3. Confirm the port survives operation: programming traffic, HMI pass-through, simultaneous roles and server connection counts.
  4. Query the running PLC from an independent master: defined addresses return correct engineering values, and one deliberately undefined address returns exception code 02 instead of zeros or silence.
  5. Poll at the intended rate for a full shift and watch retries, frame gaps and stale values.

Then the decision, per case. Role documented natively: buy the PLC and commission from its communications manual. Role only through an option module: order the module and its CPU data exchange as explicit line items. Role absent: buy the PLC for control and put the slave role in a documented converter, as in the section above. Role proposed only as user-written code: treat it as unproven — such a stack also inherits single-listener limits like the one service allowed on port 502, the conflict behind why a custom Modbus TCP slave fails on port 502, and it earns trust only when the independent-master test passes.

Questions asked

Can one PLC be a Modbus master and a Modbus slave at the same time?

Many recent controllers document both roles at once, usually with a limit on how many connections the server side accepts, or a rule that each role owns its own physical port. Older firmware sometimes gained the second role only in a later revision, so check the capability table for the revision on your quote before planning a program that polls other devices while answering a supervisory master.

What do the other Modbus exception codes mean during commissioning?

Exception code 01, illegal function, means the slave does not implement the function code you sent, for example a masked write on a server that never documented FC22. Exception code 03, illegal data value, means the request itself is out of range for that slave, such as a quantity above its documented maximum or a quantity of zero. Both point at the request or the documentation, not at the wiring.

If a PLC is documented for Modbus RTU, does Modbus ASCII come with it?

No. ASCII is a separate serial framing: each byte travels as two printable hexadecimal characters and the frame carries an LRC checksum instead of the RTU CRC, which makes it slower and incompatible frame by frame. An RTU-only slave stays silent in front of an ASCII master, so ASCII support has to appear in the capability table on its own line before you can plan on it.

Which registers should the slave map expose for a supervisory system?

Give the master a small status block alongside the process values: a heartbeat register the PLC increments every scan, so a stopped counter exposes a frozen program; a fault word; a communications error counter; and an identification register with model and firmware. Keep that block contiguous so one read request covers status and data together, and document every address in engineering units with its update behavior.

Keep reading

  • Selection guide

    Connecting a CompactLogix to a Mitsubishi A2ACPU over Modbus

    Drop the RS-232/RS-485 converter plan: it converts electricity, not protocol, and the CompactLogix DB9 port speaks DF1. Put a DF1-to-Modbus RTU gateway such as the Digi One IAP between the two PLCs, wire RS-485 from it to the A2ACPU's Modbus slave module, and confirm that module's documented register map before configuring the CompactLogix messages.

    Industrial networks

  • How-to

    How a PLC runs two Modbus networks at the same time

    Yes. Each serial port is its own independent link: the HMI polls the PLC on one port while the PLC acts as master, or slave, on a separate RS-485 Modbus RTU network. The two links share no settings — only their endpoints must match — and PLC copy logic moves any data between them.

    Industrial networks

  • Selection guide

    Selecting external Modbus I/O for an Easergy P3 relay

    The Easergy P3's External I/O function lets the relay act as Modbus master to remote I/O modules, the same pattern your P3T32 already uses with a VIO12AD for RTD and mA inputs. Against a 16-input orderable maximum, your 20-input requirement leaves a deficit of 4: choose a Modbus I/O module with at least 4 digital inputs, 8 for margin, and validate port, mode and channel types before ordering.

    Industrial networks