IMDHMIControls LibraryShop main store

How-to

How one MSG route reaches multiple Modbus TCP slaves

Industrial networks Published 6 min read

Short answer

The Modbus TCP slave is chosen by the MSG routing field, not the PCCC file address. On an SLC 5/05 that means revision F firmware with REMOTE addressing and the slave number in Remote Station Address; on EtherNet/IP it is the 1756 backplane slot. One bridge route with ipaddress=0.0.0.0 and replaceip=on turns that slave number into the last IP octet.

On this page
  1. The routing field picks the slave, the file address picks the data
  2. SLC 5/05 over CSPv4: REMOTE addressing
  3. EtherNet/IP multi-hop: the backplane slot is the slave number
  4. Why the tested PLC-5 path is not the one to build on
  5. One route that reaches every slave on the subnet
  6. Worked example: six Modbus TCP slaves at 192.168.3.70 through 192.168.3.76
  7. Verify the selection before trusting the data
  8. Questions asked

When several Modbus TCP slaves sit behind one protocol bridge, the slave is chosen by the message-routing field of the MSG instruction, never by the PCCC file address. On CSPv4 that field is Remote Station Address, which needs an SLC 5/05 on revision F firmware with REMOTE addressing selected. On EtherNet/IP it is the 1756 backplane slot of a multi-hop path. One bridge route with ipaddress=0.0.0.0 and replaceip=on then turns that number into the last octet of the device address, so six slaves need one route rather than six.

The routing field picks the slave, the file address picks the data #

Two fields in the same MSG do two different jobs. The routing field tells the bridge which downstream Modbus device the message belongs to. The file address selects data through the bridge's configured protocol-mapping table. Which field the bridge reads depends on the protocol running between the controller and the bridge:

Controller-side protocol MSG configuration Field read as the slave number
CSPv4 multi-hop = no, REMOTE addressing Remote Station Address
EtherNet/IP multi-hop = yes, ControlLogix backplane hop 1756 backplane slot number

CSPv4 is the legacy Ethernet protocol on these processors, and how CSPv4 and EtherNet/IP differ on the same processors decides which row your controller can use. LOCAL addressing cannot do this job at all: set to LOCAL, the SLC 5/05 forces the CSP destination and source values to zero, so every message arrives with identical routing and no downstream slave can be told apart.

The mapping table is configuration, not arithmetic. Which PCCC file element maps to which Modbus register area is defined in the bridge's active table, and nothing in the protocol computes a file number from a Modbus Unit ID. Read the table, point the file address at the element holding the data you want, and never encode the slave number into the file address unless the configured table explicitly works that way.

SLC 5/05 over CSPv4: REMOTE addressing #

CSPv4 addresses devices by station number, and the SLC 5/05 Ethernet documentation defines the message's Target Node as the station number whose entry in the processor's routing table holds the peer address. The bridge reuses that station field as the Modbus slave number. Configure the message this way:

  1. Confirm the processor runs revision F firmware. The older E and E1 firmware does not understand the REMOTE header in CSPv4, so the station field never reaches the bridge.
  2. Keep multi-hop set to no and select REMOTE addressing in the MSG configuration. REMOTE opens the header fields that LOCAL leaves at zero.
  3. Enter the Modbus slave number in Remote Station Address.
  4. Leave the file address tied to the mapping-table element for the data you are polling, and change only Remote Station Address when you move to another slave using the same map.

EtherNet/IP multi-hop: the backplane slot is the slave number #

  1. Set multi-hop to yes, which carries the message as EtherNet/IP rather than CSPv4.
  2. Add a ControlLogix backplane entry to the message path.
  3. Enter the required Modbus slave number as the 1756 slot. The bridge records the slot the message asked for and uses it as the destination, that is the slave address, for that message.
  4. Apply the same file-address rule: the slot selects the device, the file number selects the data.

Why the tested PLC-5 path is not the one to build on #

The PLC-5 message screens look different from the SLC 5/05's but are described as using the same remote headers from the DH and DH+ era underneath; that is reported behavior, not a verified specification. The single reported attempt, on older CSP-only PLC-5 Ethernet processors, failed. Decision: build the multi-slave Modbus TCP bridge from an SLC 5/05 with REMOTE addressing or from a controller that issues the EtherNet/IP multi-hop message. If the data originates in a PLC-5, land it in one of those first.

One route that reaches every slave on the subnet #

set ia table=1 route=1 active=on protaddr=0-254 type=ip
set ia table=1 route=1 protocol=modbustcp transport=tcp
set ia table=1 route=1 connect=passive ipaddress=0.0.0.0
set ia table=1 route=1 ipport=502 replaceip=on
set ia table=1 route=1 slavetimeout=1000 chartimeout=250
set ia table=1 route=1 idletimeout=120 errorresponse=on
set ia table=1 route=1 broadcast=replace fixedaddress=1

This route accepts slave numbers 0 through 254 (protaddr=0-254), speaks Modbus TCP on port 502, and with ipaddress=0.0.0.0 and replaceip=on keeps the bridge's own first three octets while substituting the supplied slave number as the fourth. A device at 10.3.3.45 is polled as slave 45.

fixedaddress=1 pins the Modbus TCP Unit ID to 1 whatever slave number the routing field selected. Left at auto, the Unit ID follows the slave address, so slave 45 is polled with Unit ID 45, and some Modbus TCP devices answer only Unit ID 0 or 1, the TCP-side cousin of why Modbus RTU lands on slave address 0. The remaining values tighten the link: slavetimeout=1000 ms and chartimeout=250 ms bound how long the bridge waits on a slave, and idletimeout=120 s retires an idle connection so one far-reaching route does not hold sockets open.

Because this single route can place a write on any port-502 device in that subnet, apply the gating used for safe Modbus writes to PLC output registers before enabling it.

Worked example: six Modbus TCP slaves at 192.168.3.70 through 192.168.3.76 #

Inputs:

  • Six Modbus TCP slaves at 192.168.3.70 through 192.168.3.76, the polling case that raised the question.
  • The bridge sits on the same 192.168.3.x subnet and runs the wildcard route above.
  • Design target for this example: one poll per slave per second.
  • Observed capacity behind these settings: about 55 polls per second CSPv4 to Modbus TCP and 30 polls per second EtherNet/IP to Modbus TCP, measured results rather than guaranteed ratings.

Rule in words: with replaceip=on, the slave number is the last octet of the device address. The load on the bridge is the number of slaves times the polls per second per slave, compared against the observed ceiling of the path in use.

The arithmetic:

  • Slave numbers: the last octets 70, 71, 72, 73, 74, 75 and 76, all inside the route's 0-254 range.
  • Load: 6 slaves × 1 poll/s = 6 polls/s.
  • EtherNet/IP path: 6 ÷ 30 = 0.20, or 20 percent of the observed ceiling.
  • CSPv4 path: 6 ÷ 55 = 0.11, about 11 percent.

Decision: one bridge and one wildcard route carry all six slaves at this rate on either path. Set Remote Station Address, or the 1756 slot, to 70 through 76 and leave the file address alone. Hold the total load below half the observed ceiling: 15 polls/s on the EtherNet/IP path and about 27 polls/s on CSPv4. Above 15 polls/s on EtherNet/IP, split the slaves across a second bridge or use the CSPv4 path; a requirement of 4 polls per slave per second gives 6 × 4 = 24 polls/s, past the line, so act rather than hope.

Verify the selection before trusting the data #

Bring the slaves up one at a time, the same discipline as commissioning five VFD drives on one Modbus gateway, and confirm each step:

  1. Poll one Modbus TCP device directly at its address on port 502 and prove the registers and the service answer without the bridge in the path.
  2. Send one MSG with the lowest slave number selected and confirm the device at that address answered with the values your mapping-table element names.
  3. Repeat with the next slave and the same file address. A clean redirect proves the routing field, not the file number, selects the device.
  4. Measure the achieved poll rate under full load and compare it with the observed ceiling for your path.
  5. If direct polling works but the bridged message fails, work through the route range, the replaced octet, the Unit ID, the addressing mode and the firmware revision, in that order, before touching the mapping table.

Questions asked

Does the MSG file address pick the Modbus slave?

No. The routing field does: Remote Station Address on a CSPv4 message, the 1756 backplane slot on an EtherNet/IP multi-hop message. The file address only indexes the bridge's configured protocol-mapping table, so its meaning comes from that table rather than from the Modbus address space. Read the active table before choosing a file number, and change the routing field, not the file number, to reach the next slave.

Why does the SLC 5/05 need revision F firmware for multiple slaves?

REMOTE addressing carries the station number in the CSPv4 header, and only the revision F firmware generates that header. On E or E1 firmware the processor is limited to LOCAL addressing, which forces the CSP destination and source values to zero, so the bridge cannot tell one downstream slave from another.

What Unit ID do the slaves see when fixedaddress is auto?

The bridge copies the selected slave number into the Modbus TCP Unit ID, so slave 45 is polled with Unit ID 45. Devices that accept only Unit ID 0 or 1 need fixedaddress=1, which pins the Unit ID to 1 regardless of which slave the routing field selected.

Can the wildcard route reach slaves on another subnet?

No. With ipaddress=0.0.0.0 and replaceip=on the bridge keeps its own first three octets and substitutes only the fourth, so the wildcard route covers the bridge's own subnet. A device on another subnet needs its own route entry carrying that device's full IP address, the way a single-device route is configured.

How fast can this bridge actually poll?

The tests behind these settings observed roughly 55 polls per second from CSPv4 to Modbus TCP and about 30 polls per second from EtherNet/IP to Modbus TCP. Those are measured results on that bridge, not guaranteed ratings; the limit traced to the bridge's operating-system task scheduling rather than its 32-bit 66 MHz processor.

Keep reading

  • Troubleshooting

    Fixing SCADA coil oscillation through a Modbus gateway

    The oscillation is a translation fault, not a plant fault: when an upstream read fails, the gateway most likely answers the master with null data instead of a Modbus exception, so coils at 1 appear to flip every poll. Order the gateway timeouts strictly descending, pace the master's polling, and route to the SLC 5/05 over CSPv4 — the documented fault interval went from under two weeks to two months.

    Industrial networks

  • Explainer

    Can a Modbus write change PLC outputs?

    Yes, but not by outrunning the scan. On a Modicon CPU the communication interface reaches data memory only between scans, so a write is applied whole and the next scan either consumes it or overwrites it. The real exposure is that Modbus TCP authenticates nothing: any host that can reach the CPU can write an unprotected holding register your logic unpacks into outputs, so pack status into read-only words, keep commands in a separate writable range, and enforce write protection with an IP access control list.

    Industrial networks

  • How-to

    How to commission five VFD drives on one Modbus gateway

    Prove the link in three passes: open the Modbus TCP connection to the gateway, verify one read from one drive against its own display, then run one serial transaction at a time across all five. A TCP-to-RTU gateway must serialize every RS-485 request, so schedule run commands ahead of power reads instead of polling all five at once.

    Drives and motion