Blog / Connectivity
Connectivity · Guide

Modbus Machine Data for OEE: Registers and Polling

OL By OEE Lab Editorial |Updated 2 November 2026 |7 min read
Short answer

A Modbus client polls a device on the machine for values, using its register map and read function codes 01-04 only. For OEE, read run status and a total count every second or two, and calculate the changes in your software.

What Modbus gives you, in plain terms

Modbus is a simple request and reply protocol. A client asks a device for a block of values, and the device answers.

You will find it on many PLCs, drives, power meters, temperature controllers, counters and remote I/O modules. That makes it a common way in when a machine has no modern interface.

It comes in two common forms. Modbus RTU runs over serial, usually RS-485, and Modbus TCP runs over Ethernet, normally on port 502.

The older documents say master and slave, and newer ones say client and server. They mean the same roles.

The four data types and how to read them

Everything in Modbus lives in one of four tables. For monitoring, you need only their read function codes.

TableUsual notationSizeRead codeExample use
Coils0xxxx1 bit01A run or output bit
Discrete inputs1xxxx1 bit02A sensor or contact state
Input registers3xxxx16 bits04A measured speed or current
Holding registers4xxxx16 bits03Counters, status words, setpoints
The maker's register map tells you which table holds each value. Function codes 05, 06, 15, 16, 22 and 23 write to the device: do not use them for monitoring.

Read the register map first

Without a register map, Modbus is a list of numbers with no labels. Get it from the device manual or from the person who programmed the machine.

A map tells you the address, size and scale of each value. Here is what one might look like for a hypothetical machine.

RegisterValueTypeNote
40001Status word16-bit bitsBit 0 = running, bit 2 = fault
40002Fault code16-bit unsigned0 = no fault
40003Speed16-bit unsignedValue / 10 = parts per minute
40011-40012Total count32-bit unsigned40011 = high word
A made-up map to show the form. Real addresses, word order and scales come from your device's manual.

Decoding the values

Status 5 = binary 101: bit 0 and bit 2 are on
Speed 1234 / 10 = 123.4 parts/min
Count = high x 65,536 + low
1 x 65,536 + 2,464 = 68,000 parts
Three checks for the map above: bits from a status word, a scaled value and a 32-bit count from two registers.

Four traps that give wrong numbers

  • The off-by-one address. Register 40001 is sent on the wire as address 0 of the holding registers. Some tools want 40001 and others want 0, so one wrong setting shifts every value.
  • Word order. A 32-bit value spans two registers, and devices disagree on which comes first. If a count jumps wildly near each 65,536 step, swap the words.
  • Signed against unsigned. The same 16 bits can read as 65,000 or as -536. Check the type in the map.
  • Hidden scaling. A value of 1234 may mean 123.4 or 12.34, so confirm the scale by comparing with the machine's screen.

An error reply can help you here. Exception code 01 means an illegal function, 02 an illegal data address, often a wrong address or a block that runs past the map, and 03 an illegal data value, such as asking for too many registers.

How polling works, and how long it takes

Modbus devices usually do not send anything until they are asked. So a client loops through its list, reading each device in turn.

On an RTU bus only one request can be in progress at a time, so the loop time grows with each device. You can estimate it before you wire anything.

Example: a client reads 10 registers from each of 8 devices with an 8E1 serial format (8 data bits, even parity, 1 stop bit), which uses 11 bits per byte once you add the start bit. The request takes 8 bytes, and the reply takes 25.

9600 baud: 65.8 ms per device527 ms a loop
19200 baud: 42.9 ms per device343 ms a loop
Estimated time to read all 8 devices once. Each read = 33 bytes x 11 bits, plus 2 silent gaps of 3.5 characters, plus an assumed 20 ms device delay.

That fits a 1 or 2 second poll. Double the devices or read much larger blocks, and it may no longer fit, so measure the real loop on your bus.

Modbus TCP removes the shared serial line, and each device has its own connection. Many devices still limit how many clients they accept, so check before you add a second one.

What to poll, and how often

Poll the fast-changing values often and the rest slowly. A sensible start for OEE looks like this.

  • Status word and count: every 1-2 seconds.
  • Speed and fault code: every 1-5 seconds, or read the fault code when status changes.
  • Order or recipe number: every 30-60 seconds.

Polling has a blind spot, because it sees only the moment of each read. A bit that turns on and off between two polls never appears at all.

Counts suffer less, because a counter keeps its total between reads. So prefer a running total over a "part made" pulse bit, and take the change between reads.

The right read rate and counter rollover math are in PLC signals for OEE, which also covers which signals to choose. Then turn those signals into states with machine state detection.

Connecting safely

1
Get the map and settings
Note the address or IP, and for RTU the baud rate, parity and device ID.
2
Connect
A qualified electrician or controls technician does any cabinet wiring. On RS-485, check each maker's A and B labels, as they differ, and terminate the two ends of the bus.
3
Read one value by hand
Use a test tool on a laptop, with read function codes only.
4
Compare with the machine
The running bit and the count must match the machine's own screen and a hand count.
5
Schedule the poll
Add values slowly, and watch for timeouts or any effect on the machine.
Prove one register by hand before you connect any software.
  • Only one RTU client per bus. If an HMI already polls the serial bus as its client, you cannot simply add another. A second port, a gateway designed to share the bus, or a read from the HMI side may solve it.
  • Lock writes out. Some gateways can restrict a connection to read codes, so use that where available.
  • Keep it off open networks. Classic Modbus has no login or encryption, and anyone who can reach the device can send it commands. Keep it on a separated machine network.
  • Go gently on old devices. A slow device can time out under fast polling. Start slow, then speed up.

Where a gateway fits

Your OEE software may not poll Modbus devices itself. An IIoT gateway polls the devices, adds time stamps and sends the results on, often using a different protocol.

It can also store data during a network gap, which protects your counts.

Worked example: from registers to OEE inputs

Example: the count register reads 68,000 at the start of a shift and 87,200 at its end. The status bit shows 400 minutes of running out of 480 scheduled, with an ideal rate of 60 parts a minute.

  • Parts made = 87,200 - 68,000 = 19,200
  • Availability = 400 / 480 = 83.3%
  • Performance = 19,200 / (400 x 60) = 80.0%

Quality needs a good or reject count, from another register or a separate source. Then check the full result in the OEE calculator.

Modbus is one route, and not every machine offers it. If yours does not, see how to connect old machines.

See it live in Fabrico

Registers are only the raw input to an OEE number. Fabrico is a light MES for OEE: it takes stops, speed and counts live from PLCs or IoT sensors, with add-on AI cameras counting output where a machine has no usable signal, gives OEE per line and shift, and lets operators tag the cause at the line. See how Fabrico connects to machines.

What people ask next

What is the difference between Modbus RTU and Modbus TCP?

RTU runs over a serial line, usually RS-485, and one client talks to devices in turn. TCP runs over Ethernet, normally on port 502, and each client uses a network connection. The register model is the same in both, so the same map applies.

How many registers can I read at once?

The standard allows up to 125 registers in one read with function code 03 or 04, and up to 2,000 bits with 01 or 02. Some devices allow less, so check the manual. Reading neighboring values in one block is faster than many small reads.

Why do my Modbus values look wrong?

The usual causes are an off-by-one address, swapped word order on 32-bit values, a signed or unsigned mix-up, or a missing scale factor. Read one value with a test tool and compare it with the machine's screen. Change one setting at a time.

Can Modbus tell me the cause of a stop?

Only as far as the device reports it. A fault code register can show the machine's alarm, but a human cause such as waiting for material needs an operator tag. See downtime reason codes.

Can polling Modbus affect the machine?

Reads are normally low risk, but a slow device or a busy bus can be affected by heavy polling. Start slowly, watch the machine and raise the rate step by step. Keep write function codes out of the setup entirely.

See OEE per line and shift on your own machines

Fabrico is a light MES for OEE. It takes stops, speed and counts from PLCs or IoT sensors, with add-on AI cameras counting output where a machine has no usable signal, and operators tag the cause at the line.

Book a Fabrico demo

Related guides: MES vs HMI: Two Screens, Two Different Jobs · MES OPC UA Integration: Setup and Common Traps

← More OEE Lab guides · PLC signals for OEE →

OEE essentials: OEE calculator · What is OEE · Six big losses · Availability · TEEP · Cost of downtime · OEE benchmark · Free OEE tracker · Free OEE software · How to track downtime · How to implement OEE · Light MES vs full MES