4.69 out of 5
4.69
2144 reviews on Udemy

Mastering Modbus RS485 Network Communication

Learn how to design, implement and manage the most popular automation networking system in the world.
Instructor:
Emile Ackbarali
6,474 students enrolled
English
The Origins of the Modbus Protocol and RS485
Understand Memory Address vs. Memory Value
Memory Addressing Conventions
Typical Device Memory Map
Protocol Network Messaging
RS485 Standard and Device Interconnection
Protocol Data Frame Structure
Query - Response Cycle
Function Codes and Master Commands
Modbus Simulation using FREE Simulation Software
Troubleshooting and Exception Codes
Floating Point Data Structure
Modbus Communication with Programmable Logic Controller
Full Course Support Documentation

The Modbus protocol is the oldest and still by far the most popular automation protocol in the field of process automation and SCADA. Knowing how to create Modbus based networks that run on the RS485 serial communication standard is essential for any electrical technician and engineer working in these fields. Being able to integrate devices from different manufacturers is a skill that is in demand and will ultimately make you more valuable and marketable in the industry.

This course gives you the theory behind the Modbus Protocol as well as RS485. It then goes on to show you how they work together to create a Modbus RS485 network. Two freeware applications are then used to create a Modbus network right on your PC so you can see the communication in action. 

After completing this course, you will be able to integrate devices from the same manufacturers and different manufacturers, that are Modbus compliant, to form a complete seamless network.

Introduction

1
If you did the "The 1-Hour Modbus RS485 Primer" Course
2
Accessing Attached Resources and Setting Optimal Video Resolution
3
Importance of Modbus RS485

The Modbus protocol is the widest used fieldbus protocol in the automation industry. Almost every piece of intelligent device supports the Modbus protocol, which means that a thorough working knowledge of it is essential to knowing how to interconnect devices from the same and different manufacturers together.

Our course goal is simple: To give you the knowledge that will allow you to interconnect devices from various manufacturers using the Modbus protocol over an RS485 network.

We strongly feel that this skill will make you very valuable and marketable in the field of SCADA and Process Automation.

Some History

1
History of the Modbus Protocol

Many have used the Modbus protocol for years without understanding the reason for it's existence. In this lecture we look at exactly why and how the Modbus protocol was created. Lecture outline:

Distributed Control Systems - expensive to purchase, operate and maintain
The advent of the PLC from Modicon Corporation
The need for PLC interconnection - the birth of Modbus
Modbus as a simple and open fieldbus
The rapid adoption and spread of Modbus
2
History of RS485

The precursor to USB was RS232. Besides being used in the computer industry, RS232 found many uses in the automation industry. Efforts to improve on RS232 for automation purposes lead to RS485. In this lecture we will look at:

The original use of RS232
Drawbacks of RS232 for automation
RS485 standard solves RS232 drawbacks
RS485 advantageous properties
3
Common Misconceptions

Because the Modbus protocol is frequently implemented using an RS485 network, many believe that they depend on one another. This is simply not true. Both RS485 and Modbus can stand on their own in various applications. In this lecture we look at:

Modbus and RS485 key misconception
Modbus Protocol vs. RS485 Electrical Standard
Modbus used over multiple types of media
Why they are frequently implemented together

Course Problem to be Solved

1
The Design Problem

Learning new concepts is always easier and much more effective when we can apply that concepts to a particular problem situation.

That is what we are going to do in this lecture.

In fact, from this point onward, we will refer to this problem at the end of each section of the remainder of this course, each time solving more and more of it until we completely solve it at the end.

The problem involves the interconnection of three PLC's via Modbus RS485 for the purpose of transferring data from two of them into a single one. The latter will then be responsible for transmitting the data wirelessly to a central point.

The Modbus Protocol Memory Map

1
Modbus RTU vs. ASCII

When the Modbus protocol was developed, the specification implemented two different modes of operation: Modbus RTU and Modbus ASCII. In this lecture we will cover:

Modbus RTU vs. Modbus ASCII
Advantages of RTU over ASCII
Very high prevalence of Modbus RTU over ASCII
2
Modbus Device Components

Devices that support the Modbus protocol have three things in common. They are the:

1. Microprocessor or Central Processing Unit
2. Modbus Memory
3. Communication Interface
3
Memory Address vs. Value

Before we get into the specific way that Modbus memory is arranged, there are a few basic concepts about electronic memory in general that we must cover in this lecture. Lecture outline:

Memory divided into Memory Blocks
Memory Blocks have different sizes
Memory Address vs. Memory Value
PLC Memory block example to illustrate
4
Memory Block Sizes

Memory blocks can come in different sizes. They are designed in different sizes mostly according to their purpose within the device in which they are used. We look closely at the various sizes and uses of Memory blocks. Lecture outline:

Memory block size measured in Bits
Bit = binary digit, binary counting system
1-bit to 32-bit sizes
Typical uses of different sizes
Illustration of use through an example
5
The Modbus Memory Map

Within every Modbus compliant device there will be a portion of the memory that will be dedicated to Modbus. This portion is known as the Modbus memory area or Modbus memory map. Lecture outline:

Modbus memory divided into 4 areas
Coils, Inputs, Input and Holding Registers
Memory area ranges and sizes
Purposes of each memory area
How the areas are linked to device I/O
6
Modbus Memory Map Exceptions

Modbus memory is usually linked to the device I/O. However, more sophisticated devices will use memory for calculations and storage of cumulative or calculated values. This lecture looks at an example of this and explains why this evolution has taken place.

7
Determining I/O Mapping to Memory

Many of the devices that are Modbus compliant that you will come across will most likely have some form of direct connection to physical parameters in the real world.

It could be anything, motor speed, pressure, temperature, switch or breaker position. These devices would most likely be tied to some form of sensor or actuator that would be interacting with the real world.

Now even though the Modbus memory areas of coils, inputs, input registers and holding registers would be the same from device to device, the usage of the individual memory blocks will most likely be different.

And this is where the device documentation will come in.

8
Application to our Design Problem

Now that we have covered Modbus memory mapping, we will look again now at our design challenge from Lecture 5 and see how Modbus memory applies to it and how we can start on our way toward the solution.

Modbus Protocol Network Messaging

1
Messaging Method

In the previous section we learned all about how Modbus memory is arranged in devices that are Modbus compliant. In this lecture we will start a look at how the actual Modbus communication takes place among devices. Lecture outline:

Request - Respond system
Master/Slave architecture
Single Master - Multiple Slave system
Modbus master permanence
2
Modbus Unit ID

The Modbus Unit ID is a unique identifier given to every Modbus complaint device that is connected to a Modbus network. This Unit ID is essential to the proper operation of the network. Lecture outline:

Modbus Unit ID purpose
Role in network communication
Role in master/slave system
Illustration through example network
3
Modbus Request Commands

The Modbus master device on the network is the one that sends request messages to the slave devices on the network. All request commands, however, are not the same.

In this lecture we are going to look at the major types of request commands that a modbus master device can send to a slave.

Lecture outline:

Read Coil Status
Read Input Status
Read Holding Registers
Read Input Registers
Force Single Coil
Preset Single Register
4
Modbus Block Reads

In this lecture we look at the request commands in detail and explore the concept of block reads. Block reads is the particular way in which Modbus reads data. Lecture outline:

Data read in consecutive blocks only
Master start block and number of blocks
Illustration of block reads - Example
5
Application to our Design Problem

Now that we have covered Modbus messaging, we will look now again at our design challenge from Lecture 5 and see how Modbus messaging applies here and carry the solution still further toward being completely solved.

The RS485 Serial Communication Standard

1
Physical Connection

RS485 is not a protocol but rather a Serial Communication Standard. In this lecture we will look at the characteristics of RS485 and it's physical connection arrangement. Lecture outline:

RS485 port details
Multi-drop connection arrangement
Two wire interconnection style
2
Port Settings

Every RS485 communications port has configuration parameters associated with it. In this lecture we take a look at these common communication parameters and their meanings. Lecture outline:

Baud Rate
Number of data bits
Number of stop bits
Parity error checking
3
Application to our Design Problem

Now that we have covered the RS485 standard, we will look now again at our design challenge from Lecture 5 and see how RS485 communication applies here.

This will bring us to the complete solution to our Modbus RS485 network problem.

The Query-Response Cycle

1
From Theoretical to Practical

At this point in the course, we are going to move from a theoretical understanding of Modbus to a more practical view of it. 

2
Introducing the Query-Response Cycle

The Query-Response cycle is the core of all Modbus communications. Almost all Modbus communication follows the format of the Query-Response cycle. To use the Modbus software tools to their fullest capacities, you must know the Query-Response cycle very well. 

3
Composition of the Query-Response Cycle

Here we will be looking at the various sections that make up the Query as well as the Response byte streams. Each section will be identified and it's purpose explained. 

4
The Byte Notation

This is a short lecture making you aware of the notation that will be used for the rest of the course to describe a single byte in a byte stream. 

5
The Read Input Registers Query-Response Cycle Part 1

In this lecture we set up, using our application design problem, a scenario for an example where the Read Input Registers command must be used. In the lectures to come, we will use this example to create both the Query and Response byte streams.

6
The Read Input Registers Query-Response Cycle Part 2

In this lecture, we begin the process of building the query byte stream for the Read Input Registers example.

7
The Read Input Registers Query-Response Cycle Part 3

In this lecture, we continue the process of building the query byte stream for the Read Input Registers example.

8
The Read Input Registers Query-Response Cycle Part 4

In this lecture, we complete the process of building the query byte stream for the Read Input Registers example.

9
The Read Input Registers Query-Response Cycle Part 5

In this lecture, we begin the process of building the response byte stream for the Read Input Registers example.

10
The Read Input Registers Query-Response Cycle Part 6

In this lecture, we complete the process of building the response byte stream for the Read Input Registers example.

11
The Read Input Status Query-Response Cycle Part 1

In this lecture we set up, using our application design problem, a scenario for an example where the Read Input Status command must be used. In the lectures to come, we will use this example to create both the Query and Response byte streams.

12
The Read Input Status Query-Response Cycle Part 2

In this lecture, we build the query byte stream for the Read Input Status example.

13
The Read Input Status Query-Response Cycle Part 3

In this lecture, we build the response byte stream for the Read Input Status example.

Introduction to Modbus Software Tools

1
Basic Guidelines
2
Identifying the Modbus Software Tools

The 3 Modbus software tools are identified are their purposes given.

3
Downloading the Modbus Software Tools

This lecture identifies the websites from which the Modbus software tools can be downloaded.

4
Introduction to Virtual Serial Port

This lecture introduces Virtual Serial Port that allows the creation of a virtual Modbus network on your computer.

5
Introduction to Modscan32

This lecture introduces the Modbus Master simulator known as Modscan32. 

6
Introduction to Modsim32

This lecture introduces the Modbus Slave simulator known as Modsim32. 

7
Simulating the Read Input Registers Command

The Modbus software tools are used to simulate a master slave query response cycle involving the Read Input Registers Command.

8
Data Traffic for Read Input Registers Command

The mode of Modscan32 is switched to examine the actual byte streams simulated by the Modbus software tools.

9
Simulating the Read Input Status Command

The Modbus software tools are used to simulate a master slave query response cycle involving the Read Input Status Command.

10
Data Traffic for the Read Input Status Command

The mode of Modscan32 is switched to examine the actual byte streams simulated by the Modbus software tools.

Simulation of Modbus Commands

1
Simulating the Read Holding Registers Command

The Modbus software tools are used to simulate a master slave query response cycle involving the Read Holding Registers Command.

2
Data Traffic for the Read Holding Registers Command

The mode of Modscan32 is switched to examine the actual byte streams simulated by the Modbus software tools.

3
Simulating the Read Coils Status Command

The Modbus software tools are used to simulate a master slave query response cycle involving the Read Coils Status Command.

4
Data Traffic for the Read Coils Status Command

The mode of Modscan32 is switched to examine the actual byte streams simulated by the Modbus software tools.

5
Modbus Write Commands

The two remaining Modbus commands are write commands.

6
Downloading the CAS Modbus Scanner

Where to go to get the CAS Modbus Scanner.

7
Viewing Data Traffic in Hexadecimal Format

Using Modscan32 to view the data traffic in hexadecimal format.

8
Updated Application Design Problem

In this lecture, two more instruments are added to the application design problem.

9
The Force Single Coil Query-Response Cycle

A look at the expected query-response cycle for the force single coil example from our application design problem,

10
Simulating the Force Single Coil Command

Using the CAS Modbus Scanner and Modsim32 to simulate the force single coil command.

11
The Preset Single Register Query-Response Cycle

A look at the expected query-response cycle for the preset single register example from our application design problem,

12
Simulating the Preset Single Register Command

Using the CAS Modbus Scanner and Modsim32 to simulate the preset single register command.

Modbus Exception Codes

1
Introduction
2
Exception Codes
3
The Query-Response Cycle for an Exception Response
4
Simulating an Exception Response

Floating Point Data

1
Modbus Data Type Limitations

The limitation of the 16-bit memory block data type representation.

2
Floating Point Forms

Single Precision and Double Precision floating point forms.

3
Floating Point Format

The sign/exponent/mantissa representation used in Floating Point values.

4
Floating Point Online Conversion Tool

An online tool that is invaluable when dealing with Modbus related Floating Point communication.

5
Simulating Floating Point Communication

Using Modscan32 and Modsim32 to simulate an actual Master-Slave Floating Point data exchange.

6
Simulating Swapped Floating Point Communication

The challenge with Floating Point and Swapped Floating Point compatibility.

Configuration of the Direct Logic DL05 PLC for Modbus Communication

1
Introduction

Moving from Modbus simulation to a live physical device.

2
Overview of the Direct Logic 05 PLC

A look at the different physical characteristics of the Direct Logic 05 PLC.

3
The 2 Steps to Configuring Modbus on a Physical Device

All devices share these 2 common steps in their configuration for Modbus.

4
Looking at the Direct Logic PLC on my desk

I show you my Direct Logic PLC and how it is powered and connected as it resides on my desk.

5
Direct Logic 05 Documentation for Communications Port Configuration.

A look at the part of the documentation that deals with Modbus Port Configuration.

6
Using the DirectSoft 6 Configuration Software to configure Modbus

Using the DirectSoft 6 Configuration Software to configure Modbus

7
Direct Logic 05 Documentation for Modbus Memory Map

A look at how the native memory address and I/O map to standard Modbus addresses.

8
Switching the Communications Cable from Port 1 to Port 2

Switching the Communications Cable from Port 1 to Port 2

9
Closer look at the Modbus Mapping within the PLC

Closer look at the Modbus Mapping within the PLC.

10
Using Modscan32 to Read/Write for Coils

Using Modscan32 to Read/Write for Coils.

11
Using Modscan32 to Read Input Statuses

Using Modscan32 to Read Input Statuses

Essential Documentation

1
Print These 2 Documents and Keep Them Close

Course Support Documentation

1
Modbus History and Overview
2
Modbus RTU vs ASCII
3
Modbus Message Structure
4
Modbus Serial Transmission Modes
5
Modbus Addressing
6
Modbus Function Codes
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.7
4.7 out of 5
2144 Ratings

Detailed Rating

Stars 5
1281
Stars 4
720
Stars 3
120
Stars 2
19
Stars 1
4
30-Day Money-Back Guarantee

Includes

4 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion
Mastering Modbus RS485 Network Communication
Price:
$44.98 $37

Community

For Professionals

For Businesses

We support Sales, Marketing, Account Management and CX professionals. Learn new skills. Share your expertise. Connect with experts. Get inspired.

Community

Partnership Opportunities

Layer 1
samcx.com
Logo
Register New Account
Compare items
  • Total (0)
Compare
0