0% found this document useful (0 votes)
33 views15 pages

Tran Thien Thuan - SCADA

The document provides an overview of Modbus communication, detailing both Modbus RTU and Modbus TCP/IP protocols used in industrial automation for data exchange between Master and Slave devices. It explains the structure, functions, and connection setup for Modbus RTU, including reading coils, discrete inputs, and registers, as well as the advantages of Modbus TCP/IP for communication over Ethernet networks. The document emphasizes the reliability and efficiency of these protocols in various industrial applications.

Uploaded by

Thuận Trần
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)
33 views15 pages

Tran Thien Thuan - SCADA

The document provides an overview of Modbus communication, detailing both Modbus RTU and Modbus TCP/IP protocols used in industrial automation for data exchange between Master and Slave devices. It explains the structure, functions, and connection setup for Modbus RTU, including reading coils, discrete inputs, and registers, as well as the advantages of Modbus TCP/IP for communication over Ethernet networks. The document emphasizes the reliability and efficiency of these protocols in various industrial applications.

Uploaded by

Thuận Trần
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/ 15

Practice 1: Modbus communication

Full name: Trần Thiên Thuận


Student ID: 21070284
Course : SACADA
Date: Hanoi, 31 October 2024
I.Modbus RTU
1. Definition
Modbus RTU (Remote Terminal Unit) connection is a commonly used
communication method in industrial automation and control systems, designed to
enable data exchange between a Master and multiple Slave devices over a serial
communication line. In Modbus RTU, data is transmitted in binary format, making
it efficient and compact, ideal for environments requiring reliable communication
over longer distances. The RTU format uses an 8-bit encoding system with a cyclic
redundancy check (CRC) to ensure data integrity, and the protocol operates on
popular serial interfaces like RS-232, RS-485, or RS-422, with RS-485 being
preferred due to its support for longer distances and multiple devices on the same
network.
In a Modbus RTU network, a Master device initiates communication by sending a
message containing a Slave address, a function code, data, and a CRC for error-
checking. Each Slave on the network has a unique address and only responds if it
matches the address in the Master’s request. If no errors are detected, the addressed
Slave will execute the requested action such as reading or writing data and reply to
the Master with the requested information. The network operates in half-duplex
mode, meaning that data flows in one direction at a time, either from Master to
Slave or vice versa, reducing potential communication conflicts on the line.
Due to its straightforward, reliable structure, Modbus RTU is widely used in
industries such as manufacturing, utilities, and building automation, allowing
multiple devices like PLCs, sensors, and actuators to communicate seamlessly on a
single network. It remains a popular choice for connecting devices in industrial
environments, especially in setups requiring high reliability and straightforward
implementation with minimal overhead.
2. Connection.
First we need to install Launch Virtual Serial Port Driver, Modbus Pool, Modbus
Slave. Then we open the Launch Virtual Serial Port Driver and setting a Pair
connection: COM 7 and COM 10.

Then we open both Modbus Pool and Modbus Slave and setting the connection to
Serial Port, then we set Serials Setting in Modbus Pool COM 10 to COM 7, for the
Modbus Slave we also setting COM 7 to COM 10 in the Serials Setting.

At the start, both the Slave ID and Master ID values in Modbus Slave and Modbus
Poll are set to 0.
We set the function at both Modbus Slave and Modbus Pool to Read Coils (0x).
The Modbus Read Coils (0x) function is one of the basic operations in the Modbus
protocol, used to read the status of coils. Coils are usually digital outputs that can
be either on or off (0 or 1) and often represent devices like relays or LEDs. When
using this function, the Master device requests the Slave device to provide the
current status of one or more coils. Specifically, Function Code 0x01 (Read Coils)
is used to ask a Slave to return the state of coils from a starting address for a
specified number of coils. The coils are addressed from 0 to 65,535. In response,
the Slave device returns a series of bits, with each bit representing the status of one
coil—1 if the coil is on and 0 if it’s off. For instance, if the request is to read coils
0 through 7 and their current states are 10101011, the Slave will return a byte with
that bit pattern, indicating each coil's status. This function is valuable for
monitoring on/off device states within industrial control systems.
3.Input startus
Read Discrete Inputs, is used to read the status of digital input signals from a Slave
device. Discrete inputs are signals with only two possible states, typically
represented as on or off (0 or 1), and are often used to receive status information
from sensors or switches. When the Master requests to read discrete inputs, it uses
Function Code 0x02, with the address range for discrete inputs typically spanning
from 10001 to 165536 (referred to as 1x to distinguish it from other modes like 0x
or 3x). The Slave responds with a sequence of bits, each representing the state of
one discrete input (1 for on, 0 for off). This function is useful in monitoring sensor
or switch states within industrial environments where input statuses need to be
checked periodically or upon change.
4.Read Holding Registers
Read Holding Registers in Modbus is designed for reading values from holding
registers, which are writable memory locations in the Slave device that store
various types of data, such as analog input or output values, configurations, or
counters. The Master uses Function Code 0x03 to request values from holding
registers, which typically have an address range from 30001 to 365536, referenced
as 3x. The Slave responds with the data in the specified register range. This
function is essential for reading important device data, settings, or parameters, and
is widely used in applications needing continuous data collection.

5.Read Input Registers


Read Input Registers is a Modbus function for reading data from input registers,
which are read-only memory locations in the Slave device that hold analog or input
data. The Master sends a request using Function Code 0x04 to read these input
registers, generally ranging from addresses 40001 to 465536, designated as 4x. The
Slave returns the values in these registers, which often contain measurements or
status information from sensors or other inputs. This function is commonly used
for retrieving real-time data from sensors in industrial monitoring systems.

II.Modbus TCP/IP
1.Difinition
Modbus TCP/IP is a variation of the Modbus protocol that allows communication
over TCP/IP networks, such as Ethernet, enabling devices to connect over local
networks or even the internet. In Modbus TCP/IP, the standard Modbus message
structure is encapsulated within TCP packets, facilitating data transfer between a
Master and multiple Slave devices over a more flexible and widely supported
infrastructure compared to serial communication. Each device is identified by an
IP address and port number, with the default port for Modbus TCP/IP being 502,
allowing it to integrate seamlessly with other networked systems in industrial and
building automation environments.
In a Modbus TCP/IP network, the Master, often a PC or PLC, sends requests to
one or more Slave devices by specifying the IP address of the desired device.
Modbus TCP/IP operates on a client-server model, where the Master functions as
the client and the Slaves as servers, responding to requests to read or write data.
Because the protocol operates over TCP, it provides a connection-oriented and
error-checked communication channel, which improves reliability and allows
multiple Masters to communicate with the same Slave if needed. Each message
includes a header called the MBAP (Modbus Application Protocol) header, which
replaces the traditional CRC found in RTU since TCP handles error-checking.
Modbus TCP/IP is widely used in industrial settings requiring connectivity over
modern networks, such as factory automation, energy management, and process
control, enabling data acquisition, monitoring, and control from remote or
distributed locations. Its compatibility with Ethernet and TCP/IP networks makes it
an attractive choice for applications requiring highspeed communication, broader
device support, and integration with IT systems.
2. connection
3.Input status
4.Read Holding Registers
5.Read Input Registers

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy