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

Protocols

Modbus is a master-slave communication protocol used for data exchange between devices, where the master initiates requests to slave devices like sensors and controllers. The protocol consists of a Protocol Data Unit (PDU) and an Application Data Unit (ADU), with data organized into four main blocks: coils, discrete inputs, holding registers, and input registers. Additionally, the document discusses the Profibus family, including its versions and advantages, particularly focusing on Profibus-PA for process automation.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Protocols

Modbus is a master-slave communication protocol used for data exchange between devices, where the master initiates requests to slave devices like sensors and controllers. The protocol consists of a Protocol Data Unit (PDU) and an Application Data Unit (ADU), with data organized into four main blocks: coils, discrete inputs, holding registers, and input registers. Additionally, the document discusses the Profibus family, including its versions and advantages, particularly focusing on Profibus-PA for process automation.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

What Is the Modbus Protocol?

Modbus is a request-response protocol implemented using a master-slave


relationship. In a master-slave relationship, communication always occurs in
pairs—one device must initiate a request and then wait for a response—and the
initiating device (the master) is responsible for initiating every interaction.
Typically, the master is a human machine interface (HMI) or Supervisory Control
and Data Acquisition (SCADA) system and the slave is a sensor, programmable
logic controller (PLC), or programmable automation controller (PAC). The
content of these requests and responses, and the network layers across which
these messages are sent, are defined by the different layers of the protocol.

Layers of the Modbus Protocol


In the initial implementation, Modbus was a single protocol built on top of serial,
so it could not be divided into multiple layers. Over time, different application
data units were introduced to either change the packet format used over serial
or to allow the use of TCP/IP and user datagram protocol (UDP) networks. This
led to a separation of the core protocol, which defines the protocol data unit
(PDU), and the network layer, which defines the application data unit (ADU).

Protocol Data Unit


The PDU and the code that handles it comprise the core of the Modbus
Application Protocol Specification. This specification defines the format of the
PDU, the various data concepts used by the protocol, the use of function codes
to access that data, and the specific implementation and restrictions of each
function code.

The Modbus PDU format is defined as a function code followed by an associated


set of data. The size and contents of this data are defined by the function code,
and the entire PDU (function code and data) cannot exceed 253 bytes in size.
Every function code has a specific behavior that slaves can flexibly implement
based on their desired application behavior. The PDU specification defines core
concepts for data access and manipulation; however, a slave may handle data
in a way that is not explicitly defined in the specification.

Accessing Data in Modbus and the Modbus Data Model


Modbus-accessible data is stored, in general, in one of four data banks or
address ranges: coils, discrete inputs, holding registers, and input registers. As
with much of the specification, the names may vary depending on the industry
or application. For example, holding registers may be referred to as output
registers, and coils may be referred to as digital or discrete outputs. These data
banks define the type and access rights of the contained data. Slave devices
have direct access to this data, which is hosted locally on the devices. The
Modbus-accessible data is generally a subset of the device’s main memory. In
contrast, Modbus masters must request access to this data through various
function codes. The behavior of each block is described in Table 1.

Memory Block Data Type Master Access

Coils Boolean Read/Write

Discrete Inputs Boolean Read-only

Holding Registers Unsigned Word Read/Write

Input Registers Unsigned Word Read-only

Table 1. Modbus Data Model Blocks

These blocks give you the ability to restrict or permit access to different data
elements and also to provide simplified mechanisms at the application layer to
access different data types.

The blocks are completely conceptual. They may exist as separate memory
addresses in a given system, but they may also overlap. For example, coil one
may exist in the same location in memory as the first bit of the word
represented by holding register one. The addressing scheme is entirely defined
by the slave device, and its interpretation of each memory block is an important
part of the device’s data model.
Data Model Addressing
The specification defines each block as containing an address space of as many
as 65,536 (216) elements. Within the definition of the PDU, Modbus defines the
address of each data element as ranging from 0 to 65,535. However, each data
element is numbered from 1 to n, where n has a maximum value of 65,536.
That is, coil 1 is in the coil block at address 0, while holding register 54 is at
address 53 in the section of memory that the slave has defined as holding
registers.

The full ranges allowed by the specification are not required to be implemented
by a given device. For example, a device may choose not to implement coils,
discrete inputs, or input registers and instead only use holding registers 150
through 175 and 200 through 225. This is perfectly acceptable, and invalid
access attempts would be handled through exceptions.

Data Addressing Ranges


Although the specification defines different data types as existing in different
blocks and assigns a local address range to each type, this does not necessarily
translate into an intuitive addressing scheme for the purposes of documentation
or understanding a given device’s Modbus-accessible memory. To simplify the
discussion of memory block locations, a numbering scheme was introduced,
which added prefixes to the address of the data in question.

For example, rather than referring to an item as holding register 14 at address


13, a device manual would refer to a data item at address 4,014, 40,014, or
400,014. In each case, the first number specified is 4 to represent holding
registers, and the address is specified using the remaining numbers. The
difference between 4XXX, 4XXXX, and 4XXXXX depends on the address space
used by the device. If all 65,536 registers are in use, 4XXXXX notation should be
used, as it allows for a range from 400,001 to 465,536. If only a few registers
are used, a common practice is to use the range 4,001 through 4,999.

Profibus Types

The Profibus family consists of three compatible versions:


Profibus-DP, Profibus-PA and Profibus-FMS.

 Profibus-DP – Optimized for high speed and inexpensive
hookup. DP version is designed especially for communication
between automation control systems and distributed I/O at the
device level. Can be used to replace parallel signal
transmission with 24 V or 0 to 20 mA. This is the only card
that will be supported in this specification document.
 Profibus-PA – Designed especially for process automation. It
permits sensors and actuators to be connected on one
common bus line even in intrinsically safe areas. Permits data
communication and power over the bus using 2-wire
technology according to the international standard IEC 1158-
2. Will not be implemented in this spec because only I/O will
be controlled.
 Profibus-FMS – General-purpose solution for communication
tasks at the cell level. Powerful FMS services open up a wide
range of applications and provide great flexibility. Can also be
used for extensive and complex communication tasks. Will not
be implemented in this spec because CODE provides much of
the same function.

Advantages of Profibus PA

The introduction of PROFIBUS PA has closed the gap of digital


data communication between automation systems and field
devices. The improved functionality of PROFIBUS PA offers
advantages through all stages of a project:

During Installation Phase

Œ Reduced wiring, and therefore, ease of engineering and


installation Œ

 Faster assembly and reduced faults Œ


 Material saved for cabling Œ
Instruments can be installed in locations close to the process
for direct measurement; information is accessible remotely,
daily access is not necessary

You might also like