Modbus registers
On this page
A post office has a wall of numbered boxes. You do not ask for "the letter from the bank". You ask for box 6 and take what is inside. A meter that speaks Modbus works in the same way. A register is a numbered box that holds one whole number, and a reader asks for boxes by number. What each number means is written in a separate table.
See it
The manual of an energy meter lists total active power in register 40007. A technician enters 7 as the address to read. The meter answers, and no error appears. What does the technician get?
Each row is one register of the meter. The manual gives the register number, the wire carries the address, and the box holds only the raw number. The quantity and the scale are in the manual, not in the meter's answer.
The idea
A register is one 16-bit word inside the device: a whole number from 0 to 65,535, called the raw value or the count. Nothing in the answer says "this is a voltage". The meaning is in the maker's table, the register map.
Manuals name the registers that hold most readings with numbers that begin at 40001. The message on the wire carries an address that begins at 0. The address is the register number less 40001, so register 40007 is address 6.
A register holds whole numbers only. To carry 240.3 V, the meter stores 2,403, and the map says that one count is worth 0.1 V. This is the scale.
raw is the number in the register. scale is what one count is worth, taken from the register map.
Some values need more room and use two registers. Some registers hold negative numbers or a set of separate bits. The map says so for each one, and the lesson on Modbus register maps and scaling shows how to decode them.
One worked number
The map of an energy meter says: register 40004, current in phase L1, 0.01 A per count. The meter answers with the number 4,012. Which address was asked for, and what is the current?
Show the worked solution, 3 steps
- Turn the register number into an address
40004 − 40001 = 3. The message asks for address 3.
- Take the raw value
The meter answers 4,012. That is a count, not yet a current.
- Multiply by the scale
4,012 × 0.01 A = 40.12 A. Check it in the figure: set the slider to register 40004.
The mistake to avoid
Check yourself
The register for frequency holds the raw value 5,002. The map says 0.01 Hz per count. What is the frequency?
The map lists the voltage of phase L1 at register 40001. Which address does the message on the wire carry?
A screen shows 6,553.5 V for a supply of 240 V. Every message passes its check. What should you suspect first?
Where you meet it
- An energy meter on a feederVoltage, current, power and energy each have a register. These numbers divide a bill between departments.
- A variable speed driveThe speed command is a register that you write. The status and the motor current are registers that you read.
- A solar inverterThe energy of the day and the fault code are registers, and the map of each maker is different.
- A generator controllerFuel level, running hours and alarms are read from registers by the building system.
- A register is a numbered box that holds one whole number.
- Address = register number − 40001. A wrong address returns a neighbour, with no error.
- Value = raw × scale, and the scale comes from the register map.
- A message that passes its check can still carry the wrong reading.
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.