Easy Modbus · plain-English Modbus reference

What is a Modbus unit ID or slave ID?

Short answer

A unit ID — also called a slave ID, station address, or device address — is a number from 1 to 247 that says which device you mean when several share one connection. On an RS-485 chain with a dozen meters on it, the unit ID is the only thing distinguishing them. Native Ethernet equipment often ignores it entirely and answers on any ID. If you don't know it, try 1 first; it is by far the most common. The wrong unit ID produces either silence or a “gateway target device failed to respond” error, both of which look like equipment that is switched off.

When it matters and when it does not

Where to find it

  1. The device's own display or settings menu. Usually under Communications, Modbus, or Network. This is the authoritative answer.
  2. DIP switches. Older equipment sets the address with a bank of small switches, read as binary — switches 1 and 3 on means address 5. The legend is normally printed next to them.
  3. The commissioning paperwork. Whoever set the chain up had to assign them, and they are usually written down.
  4. Sweep for it. Ask each ID in turn and see which ones answer. Slow, because every miss costs a timeout, but reliable.

Why a sweep is slow

There is no way to ask “which unit IDs are out there?” — Modbus has no discovery of any kind. So finding the occupied IDs means trying each one and waiting for the timeout on every empty one. Sweeping 1 to 32 at a one-second timeout is half a minute of mostly waiting, and a full sweep of 1 to 247 is several minutes. Start with 1 to 32, because installers rarely go higher than they need to.

Easy Modbus has a Find unit IDs action that does this with a progress display and a cancel button, then offers to add each one it found as its own device.

Special values

Two devices with the same unit ID

On a serial chain this produces symptoms that are easy to misdiagnose: both devices answer at once, the replies collide, and what comes back is garbage or nothing. Values appear intermittently or look like they are from the wrong device. If a chain worked until new equipment was added, a duplicated unit ID is the first thing to check.