Mapping Registers to Data Reference


Thread Starter


The Parameters I have to set are:
Setpoint [Uint16]
Actual Values [Uint16]
Bit Values: for example "PowerSupply ON", "Reset", ... as only one Bit or as an Word value.

I see that there are four basic data references 0xxxx, ....4xxxx.
But if I want to write for example a setpoint or PowerSupply ON command, which address I should use for these values?<pre>
Setpoint: Function Code: 06 Address 40001? or 0001?
PowerSupply ON: Function Code: 05 Address 00001?

PowerSupply ON + Reset in a word value:
Function Code: 15 Address 00001?</pre>
Thanks a lot for helpful information.
> write for example a setpoint or PowerSupply ON command, which address I should use for these values?

No one here knows because you haven't said which Modbus slave device you are working with. Each is unique.

The address to which you write a setpoint or Powersupply ON command is defined by the manufacturer of the Modbus slave device.

The documentation for the slave device has a table of addresses that usually include the word type (integer, signed integer, floating point/real, whatever) and whether it is read-only or r/w value (3xxxx input registers addressed by 04 command are usually read-only).

The leading numeral 4 is not used in the Modbus message, it is used as an identifier associated with the 03 holding register memory area. The leading 4 tells you that the value is in a holding register, not an input register.

Some Modbus masters need the leading 4 when entering a desired 4xxxx address, others can not deal with and want the indexed value, the xxxx part, only. Sometimes you discover that by experimenting.
I'm developing a hardware which supports the Modbus/TCP Interface. Now I have to define the Register/ Address Map for a customer to
Control our Slave Device. So I have to understand the memory model and what's the best way to communicate our parameters with the customer.
We have only few parameters:

Bit values : Aktivate Power, Reset, Ready, ...
Word values: PowerSetpoint, ActualValue Voltage, ActualValue Power,..

If I have understood right, the leading digit is normally not used.
In customer documentation I have to say:
use FC 0x05 to write for example on Reg. 0x0001 "Activate Power"
use FC 0x01 to read for example on Reg. 0x000A "Ready"

use FC 0x06 to write for example on Reg. 0x0100 "PowerSetpoint"
use FC 0x03 to read for example on Reg. 0x0300 "ActualValue Voltage"

The sight of Modbus memory map is than:
0x10001: "Activate Power"
0x1000A: "Ready"

0x40100: "PowerSetpoint"
0x40300: "ActualValue Voltage"

Is it right that Reference number is in HEX (0x00000, 0x10000, 0x30000,...)?

If I want to write the Bit values as a word value should these Bit
values stand in the reference number area 0x4xxxx?
And is it possible to write the bits via FC 0x05 and with FC 0x06?

Thanks for the help.
1) Can I suggest that you Google
"generator Modbus manual"
so can see what your competitors have done as an example. Imitation is the sincerest form of flattery.

2) Since contributor Mr. Linse is too shy to proffer his suggestions for Modbus slave design, I'll offer it on his behalf:

3) There have been several threads in the past year on the topic of slave design:

where Mr. Linsee advises that a slave should reply to any request that begins in the valid memory range and append/pad unused addresses with data at a value of zero

This thread discusses Modbus memory addressing:

This thread discusses reading partial floating point values:

Slave map

And probably 10 or 20 others