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: Introduction to Modbus – Reading and Writing Data
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 > Control Systems > Introduction to Modbus – Reading and Writing Data

Introduction to Modbus – Reading and Writing Data

In this article, the author discussed the introduction of Modbus protocol, reading and writing the data format and message structure.

Last updated: November 6, 2022 12:56 pm
Editorial Staff
Control Systems
No Comments
Share
5 Min Read
SHARE

The first industrial programmable logic controller (PLC) was manufactured by the Modicon company in the United States, and very soon after the development of this revolutionary control computer that same manufacturer developed a digital communication network called Modbus designed to allow multiple Modicon PLCs to communicate data between each other over simple two- or three-conductor network cables. The development of Modbus happened in 1979, and for better or for worse this same communication protocol is still in widespread use at the time of this writing.

Contents
Modbus ProtocolModbus Write One Register Data ExchangeModbus Read Register Data Exchange

Modbus Protocol

This module introduces the Modbus protocol along with practical applications for its use. Important concepts related to Modbus include digital versus analog signaling, digital memory reading versus writing, memory addresses, serial protocols, the OSI Reference model, master versus slave network devices, data frames, error checking, encapsulation, and digital codes.

Here are some good questions to ask yourself while studying this subject:

  1. What is the purpose of a VFD?
  2. What is the purpose of a PLC?
  3. How is a PLC able to differentiate between different Modbus slave devices (e.g. VFDs) connected to it?
  4. What are some advantages and also disadvantages of using Modbus rather than analog signals for applications such as electric motor control?
  5. How does Modbus relate to various serial data protocols such as EIA/TIA-232?
  6. What are some of the limitations of Modbus inherent to its data frame format?
  7. How does ASCII differ from RTU in Modbus communications?
  8. How is encapsulation (sometimes) used in Modbus communications?
  9. How is it possible to communicate data longer than 16 bits (e.g. 32-bit floating-point values) in Modbus?
  10. What does it mean to say that Modbus is a “layer-7” protocol?
  11. How are Modbus data registers addressed within the target device?

Modbus Write One Register Data Exchange

In the following system, an industrial computer sends a Modbus query to a programmable logic controller (PLC), which in turn replies with a Modbus response.

Both devices use Modbus ASCII to communicate, which allows us to use a pair of portable laptop computers to display each message in human-readable form:

Industrial computer sends a Modbus query to programmable logic controller

ASCII message sent by the industrial computer = :050610010200E2

ASCII message sent in response by the PLC = :050610010200E2

Modbus Query

Analysis of Modbus query : 05 06 1001 0200 E2

  • : is the starting character
  • 05 is the slave address of the PLC
  • 06 is the function code (06 = “Write One Register”)
  • 1001 is the register’s relative address (relative address 0x1001 = 4097 decimal = absolute address 44098 decimal)
  • 0200 is the data to be written to register 44098
  • E2 is the message checksum (LRC)

The PLC’s response to this message is to simply echo it verbatim so that the industrial computer will be able to verify its receipt.

Modbus Read Register Data Exchange

In the following system, an industrial computer sends a Modbus query to a programmable logic controller (PLC), which in turn replies with a Modbus response.

Both devices use Modbus ASCII to communicate, which allows us to use a pair of portable laptop/computers to display each message in human-readable form:

PLC Modbus Communication

ASCII message sent by the industrial computer = :050310000002E6

ASCII message sent in response by the PLC = :050304FF0600648B

Modbus Data Format

Analysis of modbus query : 05 03 1000 0002 E6

  • : is the starting character
  • 05 is the slave address of the PLC
  • 03 is the function code (03 = “Read Register”)
  • 1000 is the starting address (relative address 0x1000 = 4096 decimal = absolute address 44097 decimal)
  • 0002 is the number of 16-bit registers to be read (two)
  • E6 is the message checksum (LRC)
Modbus Response Message

Analysis of modbus response : 05 03 04 FF06 0064 8B

  • : is the starting character
  • 05 is the slave address of the PLC
  • 03 is the function code (03 = “Read Register”)
  • 04 is the number of bytes returned (four bytes = two 16-bit registers)
  • FF06 is the value stored in register 44097
  • 0064 is the value stored in register 44098
  • 8B is the message checksum (LRC)
© 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

Questions on Ratio Control System
Documentation and Change Control of PLC or DCS Systems
History of Internet of Things (IOT)
Basics of Loop Powered Devices
Design Document for Project Systems Architecture
What is High Integrity Pressure Protection System?
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

Loop-powered 4-20 mA Transmitter Circuit Voltage drop
4-20mA Loop Power Supply Questions and Answers
Control Modes of Air Handling Unit (AHU) – HVAC Basics
Direct Digital Control (DDC) Systems
Interconnection between PLC, MCC, LCP & Pumps – Video
Concept of Redundancy in Control Systems
What is Open Systems Interconnection?
Types of Noise in Electronics

Keep Learning

Turbine Bypass System

Turbine Bypass System

How to Prevent Ground Loops in Analog Circuits?

How to Prevent Ground Loops in Analog Circuits?

Control Systems Interview Questions & Answers

Control Systems Interview Questions & Answers

LED Stumps in Cricket

How do LED Stumps in Cricket Work?

Control Panel

What is a Control Panel and its types?

Ratio control

What is Ratio Control ?

Active Barrier

What is a Active Barrier ?

Demo of a SCADA Software – Level Control System

Learn More

Temperature Sensors Interview Questions

Temperature Sensors Interview Questions

Relay Principle

Relay Principle & its Types

Speed of Power Actuators

Speed of Actuators

Why is Motor Control Required in Control Systems

Why is Motor Control Required in Control Systems?

PLC Sequential Operation Example Program

PLC Sequential Operation Example Program

What is a Compressor

What is a Compressor? Types of Compressors

Fire Pump

What is a Fire Pump? – Definition, Principle, Types, Comparison

Calibrate Eddy Current Conductivity Instrument

How to Calibrate the Eddy Current Conductivity Meter?

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?