RS-485 and Modbus/Modbus: the conversation/Four kinds of data
Lesson 9 of 12 · in 3D and VR

Four kinds of data

A Modbus server keeps its data in four tables, coils, discrete inputs, input registers and holding registers. Two hold single bits and two hold 16-bit values, and which of them a request can write depends on the table, not on the server.

Lonely BinaryUpdated 2026-10-075 min readNo board required

View it in VR

Lesson 9 of the RS-485 and Modbus course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/rs485-modbus/9

Four tables

A function code picks the table and an address picks the place in it. The tables differ in how wide an item is and whether a request may write it.

TableItemReadWrite
Coils1 bit0105, 15
Discrete inputs1 bit, read only02none
Input registers16 bits, read only04none
Holding registers16 bits0306, 16

A coil is something to switch, such as a relay. A discrete input is a bit the outside world sets, such as a switch on a wire. An input register is a value the server reports, often a measurement. A holding register is a value you read and set, such as a setting.

Function codes are decimal here: 15 is 0F and 16 is 10 in a frame.

Nothing writes a read only table

No function writes an input register or a discrete input, so a request cannot reach them.

A register is 16 bits, high byte first

Modbus sends data big-endian. The value 1000 is 0x03E8 and goes out as 03 E8. The check value is the one exception, low byte first.

Anything bigger is a convention

The protocol knows single bits and 16-bit words, and not what any value means. A 32-bit number takes two registers, a decimal is often a scaled integer or a float in two registers, and which register comes first is the device maker's choice. Devices differ, and the manual is the only source.

The tables may overlay

Nothing says the four tables are separate memory. A coil and a bit of a register may be the same bit. The specification calls that acceptable and very common, and the manual says whether a device does it.

Common mistakes

  • Writing to an input register. It is read only and no function reaches it. Look for the holding register that holds the setting.
  • Assuming a 32-bit value is built the same on every device. Test with a known value, and swap the two registers if the number is wrong by a huge factor.
  • Treating the tables as separate memory. On some devices writing a coil changes a register.

Edit this page — content/fundamentals/rs485-modbus/four-kinds-of-data.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →