0% found this document useful (0 votes)
71 views27 pages

Guide Modbus ModScan and ModSim V1 PDF

This document describes the Modbus system and its implementation using the Modscan and Modsim programs. The system consists of a Modbus field network with a master device (Modscan) and slave nodes (Modsim) that communicate via RS-232 or Ethernet. The document explains the system architecture, hardware and software components, and system installation, as well as basic Modbus functions such as coils, inputs, holding registers, and serial and TCP/IP frames.
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)
71 views27 pages

Guide Modbus ModScan and ModSim V1 PDF

This document describes the Modbus system and its implementation using the Modscan and Modsim programs. The system consists of a Modbus field network with a master device (Modscan) and slave nodes (Modsim) that communicate via RS-232 or Ethernet. The document explains the system architecture, hardware and software components, and system installation, as well as basic Modbus functions such as coils, inputs, holding registers, and serial and TCP/IP frames.
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

MODBUS PRACTICE

Modbus Serial Communication


Y Modbus Ethernet
Modsim and Modscan

1
Content
Abbreviations 3
System 3
Architecture
Overview 4
Components
Hardware 5
Software 5
Communication 6
Installation
Introduction 7
Wiring diagram 8
Record Settings Menu 9
Menus, windows, and data types 9
Modbus serial
Communication 12
Coil status 15
Input status 17
Holding register 18
Modbus serial frame 20
Modbus TCP/IP
Connection 22
Frame in Modbus TCP/IP 24
Graphics (Minis HMI) 25
Contact 28

2
Abbreviations

Expression Meaning
PLC Programmable Logic Controller
ATV Altivar Speed Drive
UTP Shielded Twisted Pair

System

Introduction

The system basically consists of a field network (Modbus) oriented towards


communication of up to 32 nodes through a master device (Computer with
Modscan) and a slave device (Computer with Modsim). The system is capable of performing
control actions as well as monitoring actions using some of the
basic functions of these Master and Slave Modbus simulation programs.

3
Architecture

Overview

The architecture illustrated below describes a 3-wire RS232 network.


the network topology consists of two devices (Personal Computer) to perform the
configuration connected via a crossover cable point to point between two
DTE.

4
Hardware

Description or
Component Image
Schematic
Personal Computer Workstation
Workstation ready for
Cantidad: 1 configure and use the network
RS232

Software

General

The software that will be used for the practical work is Modscan and Modsim.
What is the tool for monitoring and managing Serial Modbus and Modbus networks?
TCP/IP.

Modscan and Modsim is a 32-bit Windows-based program for a computer


personal (PC) that runs on Microsoft Windows 2000/XP operating systems
Professional/Windows/7.

The minimum configuration required to use both ModScan and ModSim is


the following:

A computer with a Pentium processor at 1.2 GHz or higher is recommended.


It is recommended to have 256 MB of RAM or more.
1 MB of free space on the hard drive.

Operating system: Windows 2000, Windows XP or Windows Vista/7

5
Communication

General

Basically, RS232 cables with a DB9 connector are required to carry out the
connections between the two devices that belong to the network. Additionally,
needs two USB-RS232 converters.

List of items

Cable Connection
USB to RS232 converter
Number of nodes

RS232 cable female DB9 connector


Number of nodes

6
Installation

Introduction

This chapter describes the necessary steps for hardware installation and
to comply with the following architecture of the practice.

RS232 Cable Signals.

In this table, we describe the different signals used in RS232.

Pin Signal Description


1 DCD Carrier detector

2 RXD Reception data


3 TxD Data transmission
4 DTR Ready DTE
5 GND(SG) Reference Signal
6 DSR DCE ready
7 RTS Shipping request
8 CTS Enable shipping
9 R Call indicator

7
Wiring diagram
The wiring table shown below describes all the
connections that must be made to carry out the practice.

Pin DB9 Signal 1 Pin DB9 Signal 2


1 DCD 1 NC

2 RXD 3 TxD
3 TxD 2 RXD
4 DTR 6 DSR
5 GND(SG) 5 GND(SG)
6 DSR 4 DTR
7 RTS 8 CTS
8 CTS 7 RTS
9 R 9 R

8
Records configuration menu

Below we will find some configuration menus


from Modscan as well as from Modsim
Modbus slave address

Registration address Number of requests made

Reset counter
Number of records Modbus Function

Menus, windows, and data types (some settings)

Connection or Definition of
disconnection data Show data Show Plots

Format of
data visualization

9
By clicking on the icon we can see the Modbus frames, in
black color is visible the question while without color is visible the
Modbus slave response.

In the icons Data Display Format we can


select the data display format.

10
We changed the pool time to select how often
we send the Modbus frames.

11
MODBUS SERIAL

Communication

We open the ModScan32 program.

We configure the network parameters to establish


communication through an RS485 or RS232 network

12
We open the Modsim (Modbus slave)

We select the serial communication port (Depends on


where the cable is connected.

13
We configure the port in Modsim as shown in the figure.
next (EMPHASIZING THAT THE PARAMETERS REMAIN
SAME AS THOSE CONFIGURED IN MODSCAN).

14
Coil status
We select the number of coils or digital inputs that
we want to read or write, as well as the address of the Modbus slave.

We modify the state of any coil, in this case coil 1.


we turn it ON, to do this we double click on the circle
red.

Direction of
Modbus slave

Memory address in the


slave
State of coil 1 (ON) or
0(OFF)

15
We see how the value changes in the (Modbus slave).

Now we want to change the value of a coil from the slave


towards the teacher in the same way we double click on a
coil.

Memory address in
the Master

We see how the value changes in the master (Modscan).

16
Input status

We use function two of Modbus unlike coil status this


function does not allow changing the value from the master only the
slave can modify this value. It is widely used in applications
where sensor ON-OFF monitoring is necessary since it only gives
report of your status its value cannot be modified.

Change record 1

17
Holding register
As its name suggests, it is a record that they keep when writing a value.
in this record it is kept until it is modified by a
slave or a master its value ranges from 0 to FFFF_H which is
equivalent 65535.
Just like in the previous case, double-clicking on the value will
open the window (Write register), where the value is changed.

Address of
Modbus slave

Registration address in the


memory of the Master

Value assigned to memory


of slave

By changing the value in the register, we see this new value reflected.
in the record (1) one of the slave.

18
In the same way, we write a log but from the slave.
towards the Master.

When looking at record 2, we see how its value changes.

Once this test is finished, we do the same with function 4.


of Modbus INPUT REGISTER.

19
Modbus serial frame

When changing the data, what changes is the information.


what we send through our Rs485 network this information can be
see as ones and zeros, in hexadecimal or decimal form
others.

The question the master asks the slave is seen in gray, while
that the response can be seen with a black background.

QUESTION (TEACHER)

05 Slave address (Device Id)


03 Modbus Function (HOLDING REGISTER)
Address from where you took the commission to read
00 02 Registration number that I am going to read (Length)
C5 8f CRC (Cyclic Redundancy Check)

20
ANSWER (SLAVE)

05 Address of the responding slave (Device Id)


03 Modbus Function (HOLDING REGISTER)
04 Number of bytes returned, 2 bytes is a word.
00 64 First record that we read in hexadecimal.
02 2E According to the record that we read in hexadecimal.
7F 50 CRC (Cyclic Redundancy Check).

If we change the data, we see how these fields change.

Depending on the Modbus function, this frame changes in


its shape.
To check the error checking we can verify it with the
Hex terminal program by double clicking on CRC16
we enter the data for which we want to calculate our
CRC in this case is the response from the slave.

As we can see, this number is equal to the error check.


What does Modsim send.

21
MODBUS TCP/IP
Connection
We verify the IP address on the network slaves by opening the
command prompt CMD, we enter the command IPconfig,
where we can see our IP address.

Now we open a connection and connect via remote TCP/IP.

22
We enter the IP address of the device we are going to
connect and the port for Modbus TCP/ip which is always 502.

TCP/IP address
from the Modbus slave

Modbus Port
TCP/IP

In the same way, we select Modbus/TCP,


in this case it is not necessary to enter the master's IP address anymore
he simply opens the port waiting for someone to
get in touch with him.

23
Frame in Modbus TCP/IP

We perform the same tests with each of the Modbus functions.


y we switch to Show traffic mode, we see that at the same frame
other values corresponding to the link layer are added
of Ethernet.

Modbus On TCP-ip Application Data Unit

MBAP Header
d8 00 Transfer identifier
00 00 Protocol identifier (Modbus 00 00)
00 06 Number of bytes that are sent next.
05 Slave address that responds (Device Id)

The rest of the parameters is the same as the serial frame.

24
Graphs (Minis HMI)

File
Costume forms

We make a box of the size we want our graph to be,


selecting Simple Trend Chart to create our graph.

We mark the fields exactly as they are in the figure.

2. Colors of the
How often
time ago the

3. we click to
select the
information that
let's paint

25
We enter the necessary information for the graph that is going to
to paint.
We changed the color
from our line
Maximum value of the
We enable this graphic
route
Minimum value of the
graphic
Format of
record, in this
if we give
HOLDING REGISTER

Address of
slave from where
this is the information Data format
unsigned integer
Address of
record where I read
the data

We give it Ok and then Update.

26
In the slave (Modsim) we are going to simulate the change of a value
random to see how the graph changes.

In the master we see how the value of our changes.


graphic.

27

You might also like