Here’s what more than 2,500 business decision-makers around the world say.Download the report
...with the Facility Hero app in hand! Discover how you can optimize your maintenance efforts today.Learn more
Access tailored services, 24/7 self-service and expert help. Anywhere, anytime, any project.Discover now
Everything you need to know about our IoT technology backbone.Learn more
Explore our global offerings or select your country from one of our five regions.Global
Découvrez nos offres globales ou sélectionnez votre pays dans l’une de nos cinq régions.
Goals and Symptoms
When performing Modbus read commands, it is important to apply the right starting register address in the read function. Otherwise, the wrong register will be accessed from the meter, giving unexpected data for the meter parameter being read.
Facts and Changes
Modbus, modbus rtu, function read, modbus map, holding register, staring register, function 03, modbus read packet
Causes and Fixes
One probable cause would be that, the modbus function read command is not pointing to the right registers. The modbus protocol requires an offset to be introduced in the starting register address when reading the slaves register.
When reading the meter parameters, the Master must send the device a Read Holding Registers packet. This packet must specify a start register and the number of registers to read. When the function read is received, the slave responds with a packet containing the registers in the range defined in the read request.
However, consider the 3710 Modbus map, which states that according to the MODBUS protocol, in response to a request for address 4xxxx, the master reads register xxxx-1 from the slave (3710). For example, a request for register 40011 returns register 10 from the slave.
What does the above statement mean? Why is an offset required?
Holding registers, by default, are defined the 4xxxx range, the first holding register staring at 40001. The starting register in the read packet is, on the other hand, numbered from zero. Hence, the start register zero automatically points to holding register 40001, starting register one points to holding register 40002, etc. The fact that the first holding register is 40001 and not 40000 explains the offset that needs to be introduced in the starting register number.
Hence, considering the 3710 Modbus Map statement, if the Master needs to read register 40011, then the corresponding starting register that needs to be put in the read function would be 10 (0A hex) since register 40011 is the register 10 from the first holding register, 40001:
40001 > Start register 0
40002 > Start register 1
40003 > Start register 2
40004 > Start register 3
40005 > Start register 4
40006 > Start register 5
40007 > Start register 6
40008 > Start register 7
40009 > Start register 8
40010 > Start register 9
40011 > Start register 10
The Modbus Read Request Packet for a master reading 3 registers from a slave with unit ID 100 (64 Hex) and for starting register of 40011 should be:
Start Register (40011)
# of Registers
All content © 1992-2007 Schneider Electric
Sign up for all the latest solutions, offers and best practices straight to your inbox.
We are excited that you have joined the group. You will receive your welcome email soon describing the program and what to expect in the upcoming weeks. Enjoy!