Modbus Training
Modbus Training
Modbus Training
What is Modbus ?
Communication interface
RS-232/485
Ethernet (TCP/IP)
Types of Modbus:
Flag
Address Control
trailer
Data
FCS
Flag
Modbus Serial
Modbus Frame
Modbus Serial
RTU(Remote Terminal Unit) Mode
Modbus Serial
ASCII Mode(Frame inside the characters that apply)
Modbus Frame
(0x02) Read Discrete inputs
Modbus Frame
(0x03) Read Holding Registers
Master Query
Slave Response
Slave
XMIT
Not Enabled
Master
Query
Response
Query
Response
XMIT
Active
Query
Complete
Response
Slave
OPENIN
G FLAG
BDCST
ADDRES
S
SOURCE
ADDRES
S
MAC
FUNCTIO
N
CRC
CLOSIN
G FLAG
MAC LEVEL
DEST
ADDRES
S
BYTE
COUNT
LLC
FIELD
LLC LEVEL
OUTPUT
PATH
ROUTER
COUNTE
R
TRANS
SEQUENC
E
ROUTING PATH
MODBUS
FRAME(MODIFIED)
MODBUS MESSAGE
SLAVE
ADDRES
S
FUNCTION
CODE
STARTING
ADDRESS HI
STARTING
ADDRESS
LO
NUMBER OF
REGISTER
HI
NUMBER OF
REGISTER
LO
Single cable
Modbus Plus
Network
MBAP Header
SERVER/CRIENT MODEL
SERVER
INDICATION
RESPONSE
MODBUS TCP/IP
REQUEST
REQUEST
CONFIRMATION
CONFIRMATION
CLIENT1
CLIENT3
CLIENT2
Web
server
e-m@il
HTTP
SMTP
I/O
TCP Message Scanner
open
Modbus
Modbus TCP
Read and write data
Update I / O
Benefit: Modbus Device connectivity with the
other is easy. Host computers and OPC servers
directly, without the PLC to communicate with
other devices can send and receive. .
Transparent link to Modbus Serial Devices
TCP/IP Ethernet
To Modbus Plus
Bridge
Redundant cabling
Modbus Plus
Remote I/O
Redundant power
supplies
Cable B
Redundant
CPUs140cpu671 60
Remote I/O
processors
Hot standby
processors
Cable A
Dual cable
Modbus Plus
Network
Fiber
Optic
CHS
Link
Cable A
Cable B
Dual cable
Remote
I/O
Network
CURRENT INPUTS
HI
IA
IB
.....
....
IC
LO
Doble
PowerPlex
Bitronics, Inc.
Lehigh Valley, Pa
Made in USA
POWER STATUS
Digital transducer
STATUS
SYSTEM RESETN
VOLTAGE INPUTS
DPU
TARGETS
NORMAL
A
FAIL
B
PICKUP
RECLOSER OUTC
TIME
INSTANTANEOUS 2000R
FREQUENCY
NEGATIVE SEQUENCE
Network
Partner
V1.0
C
E
TARGET RESET
Modbus
POWER POWER
I1
133
I1
A
133
I1
Direct MB+
Devices
9
A
133
DNP 3.0
Gateway
ABB or Schweitzer
Cooper
Gateway
System Communication
Modbus TCP/IP
Electrical Distribution
Reducing energy costs
Increasing energy availability
and quality
Optimizing electrical equipment
utilization
HMI
Internet
RS-232/485
P.42
Query-Response Cycle
Query
Station Number
Function Code
Data Bytes
(Flexible)
Station Number
Function Code
Data Bytes
(Flexible)
Error Check
Error Check
Response
P.43
Communication
Client/Server or Master/Slave:
Modbus uses a client/server type protocol. Sometimes referred to as
master/slave. A "master" = "client", while a "slave" = a "server".
The master/slave terms originated in industry, while the
client/server terms originated in the computer industry. Typically,
the client is the PLC or controller, while the server is a field device
such as a valve bank or sensor block.
A "client" sends a request to a "server". The server decodes the
request and sends back a response with the requested data or an
acknowledgement.
Eg. when you use a web browser to view a web page on the
internet, your web browser sends a page request to the web server.
The web server decodes the request and sends back a web page as a
response. Your e-mail client program fetches your e-mail in the
same way from a mail server.
P.44
Hardware Classification
ASCII Mode
Data system
ASCII character, 0~9,A~F
Bits per data unit
1 Start Bit
7 Data Bits
1 Start Bit
7 Data Bits
2 Stop Bit
1 Stop Bit
RTU Mode
Data system
8-bit Binary, 00~FF
Bits per data unit
1 Start Bit
8 Data Bits
1 Start Bit
8 Data Bits
2 Stop Bit
P.47
1 Stop Bit
ASCII Mode
Start
1 Char
Station Number
2 Chars
Function Code
2 Chars
Data
n Chars
Error Check
2 Chars
LRC
End
2 Chars
CR,LF
Start
Station Number
Function Code
Data
Error Check
End
3.5 Char
Silence
1 Char
1 Char
n Chars
2 Chars
CRC
3.5 Chars
Silence
RTU Mode
Byte 2, 3: protocol ID = 0
Byte 4, 5: number of bytes following
P.48
Data
System Application
Multi Serial Clients (Masters)
Internet
VxComm Technique
Modbus/TCP Slave
RS-485
RS-232
P.50
System Application
Multi Modbus/TCP Clients (Masters)
Modbus/TCP
Internet
Modbus/RTU
Modbus/RTU
P.51
Tools
MiniOS7 Utility (Download files and update OS
image)
P.53
User-defined protocol
HMI
RS-485
.. .
I-7000
I-7000
I-87K
RS-232
PLC
P.54
2 communication protocols
User-defined: port 10000
Modbus/TCP: port 502
(MTDemo50)
iMemory_DI
User-defined
iMemory_DO
User-defined
iMemory_AI
User-defined
User-defined
iMemory_AO
(MTDemo52)
Modbus/RTU master
(MTDemo53)
P.55
P.56
Modbus/TCP
Write
Modbus Kernel
Read
Slot
iMemory_DI
iMemory_DO
RS-232
User Process
iMemory_AI
iMemory_AO
RS-485
.. .
I-7000
P.57
I-7000
I-87K
Be a Modbus/RTU Master
iMemory_DI
iMemory_DO
User Process
iMemory_AI
Modbus/RTU
iMemory_AO
Modbus/RTU
User-defined Input
Input
User-defined Output
Output
P.58
User.c
void UserInit(void)
{
int iRet;
iRet=InitModbus();
}
void UserLoopFun(void)
{
UpdateIOModule();
CheckModbusRequest(iModbusUpLinkPort); //Is any Modbus/RTU request from COM port ?
CheckLEDMenu();
}
int UserCmd(unsigned char *Cmd,unsigned char *Response)
{
int iRet;
if(Cmd[0]=='!')
iRet=Configuration(Cmd,Response);
return 1;
}
P.59
MBTCP_8E.h
//Memory base address of every slot
extern unsigned int iMemoryAddr_DI[8];
extern unsigned int iMemoryAddr_DO[8];
extern unsigned int iMemoryAddr_AI[8];
extern unsigned int iMemoryAddr_AO[8];
//I/O points of every slot
extern unsigned int iMemoryNum_DI[8];
extern unsigned int iMemoryNum_DO[8];
extern unsigned int iMemoryNum_AI[8];
extern unsigned int iMemoryNum_AO[8];
//The I/O values
extern unsigned char* iMemory_DI;
extern unsigned char* iMemory_DO;
extern int*
iMemory_AI;
extern int*
iMemory_AO;
//Total DI,DO,AI,AO points
extern int iDINum,iDONum,iAINum,iAONum;
P.60
command protocol
depend on serial
devices
Internet
Modbus/TCP
command protocol
Modbus/RTU command
protocol
VxComm Technique
RS-232/485
Modbus/RTU
RS-485
RS-232
P.61
User-defined protocol
HMI
Expansion Bus
X board
Read/Write I/O
P.63
I-7000
Modbus/RTU
I-87K
7188E-MTCP Features
Converts single Modbus/TCP to multi
Modbus/RTU (Modbus/TCP slave port)
Converts single Modbus/RTU to multi
Modbus/RTU (Modbus/RTU slave port)
Supports VxComm technique for every COM
port of controllers
Allowed multi-client (or master) access
simultaneously
Firmware updateable and programmable
P.64
(Default function)
(MTDemo00)
User-defined
iMemory_DI
User-defined
iMemory_DO
User-defined
iMemory_AI
User-defined
iMemory_AO
(MTDemo02)
(MTDemo03)
P.65
Modbus Kernel
Read
Expansion Bus
X board
iMemory_DI
iMemory_DO
RS-232
User Process
iMemory_AI
iMemory_AO
RS-485
.. .
I-7000
P.66
I-7000
I-87K
iMemory_DI
iMemory_DO
User Process
iMemory_AI
Modbus/RTU
iMemory_AO
Modbus/RTU
User-defined Input
Input
User-defined Output
Output
P.67
iFix (A)
iFix (B)
iFix (C)
P.68
2
Response
iFix (B)
2
Request
iFix (C)
P.69
Ethernet/RS-232
converter
Hub
iFix (A)
11 7
3
Modbus/RTU
8 Response
iFix (A)
Modbus/RTU
Response
Modbus/RTU
Request
12
9
P.70
10
HoneyWell
Modbus/RTU device
iFix (A)
7188E-MTCP
4
Hub
1
iFix (B)
Modbus/RTU
Response
11 7
3
Modbus/TCP
Response
Modbus/TCP
Request
iFix (C)
Modbus/RTU
Request
12
9
P.71
10
HoneyWell
Modbus/RTU device
7188E-MTCP
Hub
iFix (B)
Share
Memory
Modbus/TCP
4 Response
Modbus/TCP
Request
6
5
P.72
Modbus/RTU
Request
Modbus/RTU
Response
HoneyWell
Modbus/RTU device
AB PLC #2
P.73
Solution
ABB DCS
AB PLC #1
Analog Output
AB PLC #2
Analog Input
DI
DO
AI
AO
AB PLC #3
Analog Input
P.74
2
Hub
Share
Memory
Modbus/TCP
Response
Modbus/TCP
Request
Modbus/RTU
Response
RS-485
B
A
Modbus/RTU
Request
PLC#1
6
5
P.75
PLC#2
PLC#3