0% found this document useful (0 votes)
5 views

Modbus

Uploaded by

shailesh284
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Modbus

Uploaded by

shailesh284
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

UNDERSTANDING MODBUS

Introduction:
Modbus is a widely recognized serial communication
protocol that was developed by Modicon in 1979.
Designed specifically for use with Programmable Logic
Controllers (PLCs), Modbus facilitates the exchange of
data between electronic devices.

How Modbus Works:


At its core, Modbus operates as a communication
mechanism over serial lines. It allows devices to share
and receive data in a structured manner. In this
framework, the device that requests data is referred to as
the "Modbus Master," while the devices that respond to
these requests are known as "Modbus Slaves."

@amit_jha
UNDERSTANDING MODBUS
Network Structure:
In a typical Modbus network configuration, there is a
single Modbus Master that can communicate with up to
247 Modbus Slaves. Each slave device is assigned a
unique address ranging from 1 to 247, ensuring clear
identification within the network. This structured
addressing system enables efficient management and
communication among devices.

Master-Slave Communication:
The Modbus Master has the primary role of initiating
requests for data and sending commands to the slaves. In
contrast, the Modbus Slaves respond to these requests,
providing the necessary data back to the Master. This
master-slave relationship forms the backbone of the
Modbus communication process.

@amit_jha
WHAT IS MODBUS USED FOR?
Introduction:
Modbus is an open communication protocol that
manufacturers can use without worrying about expensive
licensing fees. This open-access nature has made Modbus
a widely adopted standard in many industries, becoming
the go-to method for connecting industrial electronic
devices.

Widespread Use in Various Industries:


Because it’s open and easy to implement, Modbus is
embraced by a wide range of manufacturers across
different sectors. From manufacturing to building
management, its versatility allows devices from various
brands to communicate effectively.

@amit_jha
WHAT IS MODBUS USED FOR?

How Modbus Works in Real Life:


In practical settings, Modbus is often used to send data
from sensors and control devices to a central controller or
data collection system.
One of its key roles is within Supervisory Control and Data
Acquisition (SCADA) systems. Modbus connects a central
supervisory computer to remote terminal units (RTUs). This
allows operators to monitor and manage processes
happening far away, ensuring everything runs smoothly.

Different Versions of Modbus:


Modbus comes in various versions tailored for different
communication methods. The main types include:
Modbus RTU: This version is compact and efficient,
making it ideal for serial communications.
Modbus ASCII: A human-readable format that can also
work over serial lines.
Modbus TCP: This variant allows Modbus to run over
Ethernet, suitable for high-speed modern industrial
applications.

@amit_jha
HOW DOES MODBUS WORK?

Introduction:
Modbus is a widely adopted serial communication protocol
that enables the seamless exchange of data between
electronic devices. Its straightforward design makes it
easy for different devices to communicate with each other,
which is essential for many industrial applications.

Basic Configuration:
In its simplest form, a Modbus setup involves a single serial
cable connecting the serial ports of two devices: a
"master" and a "slave." The master device is responsible
for initiating communication, while the slave responds to
requests from the master. This clear distinction streamlines
the communication process.

@amit_jha
HOW DOES MODBUS WORK?

Data Transmission:
The foundation of Modbus communication lies in the
transfer of data represented in binary code, which consists
of a sequence of ones and zeros, known as bits. These bits
are transmitted using variations in voltage levels.
Specifically, a binary zero is represented by a positive
voltage, while a binary one is indicated by a negative
voltage. This encoding method enables clear and efficient
data transfer.

Efficiency of Communication:
Modbus is designed for rapid transmission of bits, making
it an efficient choice for real-time communications. A
common transmission speed in Modbus systems is 9600
baud, which refers to the number of bits sent every
second. This speed is effective for many industrial
applications, allowing devices to communicate quickly and
reliably.

@amit_jha
MASTER AND SLAVE IN MODBUS

Introduction:
In the Modbus communication framework, a master-slave
architecture is employed to facilitate effective data
exchange between devices. This structure is essential for
maintaining organized communication within industrial
automation systems.

Master Device:
The master device is usually a controller, plays a pivotal role
in initiating requests for data or commands. Master sends a
request to a slave device, which is typically a field device or
sensor. This request contains critical information needed for
successful communication, including:
Slave Address: A unique identifier for each slave device
on the network, which helps the master pinpoint the
exact device it wants to communicate with.
Function Code: This indicates the specific type of
operation the master wishes to perform, such as reading
data or writing new values.
Data Parameters: These parameters provide additional
details necessary to execute the command.

@amit_jha
MASTER AND SLAVE IN MODBUS

Slave Device:
Upon receiving the master’s request, the slave device
processes the command based on the provided
information. After executing the requested action, then it
transmits the data or acknowledgment back to the master.
This process ensures that the master is kept informed
about the status of various devices in the system.

Bidirectional Communication:
The master-slave communication in Modbus supports
bidirectional interaction, enabling real-time monitoring and
control of industrial processes. This capability is crucial for
efficient system operation, allowing adjustments to be
made based on feedback from slave devices.

Unique Slave Addresses:


To facilitate efficient communication, each slave device on
the network is assigned a unique address ranging from 1 to
247. This addressing system ensures that the master can
individually identify and communicate with each slave,
streamlining the data exchange process.

@amit_jha
DATA STORAGE IN MODBUS

Introduction:
In Standard Modbus, data is structured within the slave
device in four distinct tables. These tables are divided into
two categories: on/off discrete values (coils) and numerical
values (registers). Additionally, each category has a read-
only table and a read-write table, totaling four tables.

Capacity of Tables:
Each of these tables can hold up to 9999 values, making
them capable of managing substantial amounts of
information.

Addressing Scheme:
For both coils and registers, data addresses range from
0000 to 270E. This addressing structure allows both coils,
which represent 1-bit on/off discrete values, and registers,
designed to store numerical data, to be accessed
efficiently.

@amit_jha
DATA STORAGE IN MODBUS

Coil/Register Numbers, similar to location names, act as


identifiers within the tables but do not appear in the actual
messages exchanged between devices. The crucial element
in the messages is the Data Address. For instance, the first
Holding Register with the number 40001 corresponds to a
Data Address of 0000. The difference between these two
values is known as the offset. Each table has a specific
offset: 1, 10001, 30001, and 40001.

@amit_jha
UNDERSTANDING THE SLAVE ID

Introduction:
In Modbus communication, each slave device within the
network is assigned a unique identifier known as the slave
ID or unit address. This ID ranges from 1 to 247, serving a
critical role in the identification of the intended recipient for
each message transmitted across the network.

Importance of the Slave ID:


The slave ID is essential for ensuring accurate
communication between devices. It acts as the first byte in
the message sent by the master device. When the master
initiates communication, it includes the slave ID to specify
which slave is being addressed. This allows each slave
device to rapidly determine whether the incoming message
is relevant to it.

@amit_jha
FUNCTION CODES IN MODBUS
Introduction:
In the Modbus protocol, the function code plays a crucial
role in defining the actions the master device requests
from the slave device. This numerical code informs the
slave about the specific operation it needs to perform,
making it vital for effective communication within a
Modbus network.

Position in the Modbus Message:


The function code is the second byte transmitted by the
master in a Modbus message. It clearly specifies the action
that the slave should undertake, which includes
determining which table to access and whether the
operation requires reading from or writing to that table.

Structure of a Modbus Message:


A complete Modbus message is constructed using a
combination of the slave address (unit ID), the function
code, and any additional data necessary for the operation.
This structured approach ensures clear and efficient
communication between the master and slave devices
within the Modbus network.

@amit_jha
FUNCTION CODES IN MODBUS

Common Modbus Function Codes:


Below is a table presenting some of the common function
codes used within the Modbus protocol:

@amit_jha
CRC IN MODBUS

Introduction:
CRC, or Cyclic Redundancy Check, is a crucial method
used in Modbus and many other communication protocols
for detecting errors in transmitted data. By implementing
CRC, Modbus ensures that the integrity of the information
exchanged between devices is maintained.

Role of CRC in Modbus:


In Modbus, a CRC is represented as a two-byte (16-bit)
field that is added to the end of every message. Its primary
function is to detect any errors that may occur during the
data transmission process.

Importance of CRC for Reliability:


The use of CRC is fundamental to ensuring the reliability of
Modbus communication. Even a slight change in the
message—such as a single bit alteration—will likely result
in different CRC values. This capability allows the system
to promptly recognize issues and take corrective action,
thus enhancing the overall integrity of data transmission.

@amit_jha
CRC FUNCTIONS IN MODBUS

1. Calculation During Transmission


The CRC value is calculated based on every byte in the
Modbus message. This includes all relevant components
such as the address, function code, data, and any other
applicable fields. A mathematical algorithm generates a
unique CRC value that corresponds to the specific content
of the message, ensuring that any alterations can be
detected.

2. Appending the CRC to the Message


Once the CRC value has been calculated, it is appended to
the end of the message. This ensures that the complete
message, including the CRC, is transmitted as a single unit.

3. Verification at the Receiver


When the slave device receives the message, it performs
its own CRC calculation on the data received, but this time
excluding the appended CRC field. The slave then
compares its calculated CRC with the CRC that was
originally appended by the master device.

@amit_jha
CRC FUNCTIONS IN MODBUS

4. Error Detection:
If the CRC value calculated by the receiver does not match
the one included in the message, this discrepancy
indicates a potential error in the transmission. In such
cases, the receiving device can request that the sender
resend the message, thereby ensuring that erroneous data
is not processed.

@amit_jha

You might also like