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
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

What are Static UPS and Rotary UPS?
Identify Instruments in Piping and instrumentation Diagram
Identify Process Variables in P&ID
Alarm Simulator for Annunciator Logic
Alarm Annunciator Circuit with Acknowledge
How-to Create Instrument Loop Diagram (ILD)?
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

What is Alarm Management System ?
ESD System Insights: Signals for Emergency Valve Shutdown Explained
Ratio Controller Example
Why Bias used in Proportional Controller ?
What is Data Acquisition? – Elements and Components
What is an Electrical Drive? Types, Advantages, Disadvantages
How Important is VPN for Control Engineers?
Vendor Document for Project Systems Architecture

Keep Learning

DCS Commissioning Steps

DCS Commissioning Steps

Electrical and Instrument Engineers Job Profile

Instrumentation and Electrical Teams Interactions (Detail Design Engineering)

Difference between ON-OFF Controller and PID Controller

Difference between ON-OFF Controller and PID Controller

Ziegler-Nichols closed-loop Tuning

Ziegler-Nichols Closed-Loop Method (Ultimate Gain)

Distributed Control System Questions and Answers

Distributed Control System Objective Questions

control of temperature in a vessel

How to Analyze PID Controller Actions

NAMUR OPEN ARCHITECTURE

What is NAMUR OPEN ARCHITECTURE?

Basic Concepts of the Safety Relay

Basic Concepts of the Safety Relay

Learn More

Orifice Construction

How does an Orifice Measures Flow?

Ambient Air Quality Monitoring System Principle

Ambient Air Quality Monitoring System Principle

thermocouple Transmitter Formula

Calculate Process Temperature using a Thermocouple

Identify Process Variables in P&ID

Identify Process Variables in P&ID

Phase Watcher Multiphase Flow Meter (MPFM) Procedure

Difference between Accuracy, Tolerance, Uncertainty, and Error

Difference between Accuracy, Tolerance, Uncertainty, and Error

How to Measure Specific Gravity of Battery

How to Measure Specific Gravity of Battery

What is an Orifice Flange ?

What is an Orifice Flange? – Purpose and Applications

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?