Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Modbus Relative Addressing
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > Common > Modbus Relative Addressing

Modbus Relative Addressing

An interesting point of Modbus communication is that the address values specified within Modbus data frames are relative rather than absolute.

Last updated: November 11, 2022 10:02 am
Editorial Staff
Common
No Comments
Share
5 Min Read
SHARE

An interesting idiosyncrasy of Modbus communication is that the address values specified within Modbus data frames are relative rather than absolute.

Contents
Modbus Relative AddressingModbus Analogy

Since each Modbus read or write function only operates on a limited range of register addresses, there is no need to specify the entire address in the data frame.

Modbus Relative Addressing

For example, Modbus function code 02 reads discrete input registers in the device with an absolute address range of 10001 to 19999 (i.e. all the addresses beginning with the digit “1”).

Therefore, it is not necessary for the “read” command function 02 to specify the first digit of the register address.

Instead, the read command only needs to specify a four-digit “relative address” specifying how far up from the beginning of the address range (in this case, from 10001) to go.

Modbus Analogy

An analogy to aid your understanding of relative addressing is to envision a hotel building with multiple floors.

The first digit of every room number is the same as the floor number, so that the first floor only contains rooms numbered in the 100’s, the second floor only contains rooms numbered in the 200’s, etc.

With this very orderly system of room numbers, it becomes possible to specify a room’s location in more than one way.

For example, you could give instructions to go to room 314 (an absolute room number), or alternatively, you could specify that same room as “number 14 (a relative room number) on the third floor”. To a hotel employee who only works on the third floor, the shortened room number might be easier to remember.

In Modbus, relative addresses are just a little bit more complicated than this. Relative addresses actually span a range beginning at zero, while absolute addresses begin with “1” as the leastsignificant digit.

This means there is an additional offset of 1 between a Modbus relative address and its corresponding absolute address.

Returning to the hotel analogy, imagine the very first room on the third floor was room 301 (i.e. there was no room 300) and that the relative address represented the number of rooms past that first room.

In this unintuitive scheme, room 314 could be specified as “the 13th room after the starting room on the third floor”. If this seems needlessly confusing, you are not alone. Welcome to Hotel Modbus.

A few examples are given here for illustration:

  • Read the content of contact register 12440: Modbus read function 02; relative address 2439
  • Read the content of analog input register 30050: Modbus read function 04; relative address 49
  • Read the content of holding register 41000: Modbus read function 03; relative address 999
  • Write multiple output coils in register 00008: Modbus write function 15; relative address 7

In each case, the pattern is the same: the relative address gets added to the first address of that range in order to arrive at the absolute address within the Modbus device. Referencing the first example shown above: 2439 (relative address) + 10001 (first address of register range) = 12440 (absolute address).

Thankfully, the only time you are likely to contend with relative addressing is if you program a computer using some low-level language such as assembly or C++.

Most high-level industrial programming languages such as Function Block or Ladder Diagram make it easy for the end-user by allowing absolute addresses to be directly specified in the read and write commands.

In a typical PLC program, for example, you would read contact register 12440 by simply specifying the number 12440 within the address field of a “read 02” instruction.

© 2019-2021 by Tony R. Kuphaldt – under the terms and conditions of the Creative Commons Attribution 4.0 International Public License
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

What is IO-Link in Smart Manufacturing?
Metric Prefixes and Unit Conversions
Pneumatic Instrumentation
Difference between DSP and DAC – Digital Electronics
5 Best Mobile Apps to Password Protect Applications and Files
How to Achieve Sustainability in UX Design and Make a Difference?
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

Automating Lab Data Reconciliation: Key Steps to Success
Difference between Anode and Cathode
Discrete Manufacturing Automation
What is Cloud Computing? Types of Cloud Services, Components
Batch Pan Automation in the Sugar Industry
Hard-Wired Control Logic for the Pressure Alarm
Underwater Fibre Optic Cable
How to Choose the Best Tungsten Grinders for Welders?

Keep Learning

Ultrasonic Thickness Gauge

How to Use a Paint Thickness Gauge?

Difference between LVDT and RVDT

Difference between LVDT and RVDT?

Liquid Nitrogen in Instrumentation

Liquid Nitrogen in Instrumentation

Difference Between Skin Effect and Proximity Effect

Difference Between Skin Effect and Proximity Effect

Robot Anatomy

Robot – Anatomy, Configuration, Reference Frame, Characteristics

ISA symbols for Process Instrumentation

ISA Codes & Symbols for Process Instrumentation

smart-transmitters-advanced-diagnostics

Smart Transmitters Advanced Diagnostics

What is a Tachometer

What is a Tachometer? – Types, Working Principle

Learn More

Percentage-to-Current-Conversion

Formula to Calculate 4-20ma from Percentage

Mixing Process with Valve Control

PLC Mixing Process with Adjustable Timer and Valve Control

Absorption Instrumentation Questions & Answers

Absorption Instrumentation Questions & Answers

Smart Valve Monitoring

SIS Instruments and Valves Inline Testing – Safety Instrumented System

Electrical Machines Objective Questions

Electrical Machines MCQ Series 16

Rotameters Working

Rotameter Working Principle and Animation

Encoder Questions and Answers - Electrical Basics

Encoder MCQ – Electrical Drives Technology

Pressure Transmitter Calibration Setup

Pressure Transmitter Preventive Maintenance

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?