You are on page 1of 8

Wichit_ins24@hotmail.

com
0896615277

Modbus
Modbus
Modicon systems

Modbus Master
Modbus slave
Modbus Network Master
Slave 247 ID
1 247 Master
Write Slave


Modbus Open Protocol
Modbus
Modbus Protocol

Controller

Modbus Serial
Serial Master
Slave

0 1 Bit
( Voltage) 0 1
Bit
9600 bps (bits per second)

Modbus
Slave 4
Discrete
On/Off (Coil)
(Register)
Coil Register Read-only
Read-write
9999 ()
Coil Contact Discrete
Address 0000 270E (
0 9998)

Coil / Register Number Location name Data Address


Function Code
Slave Network Address
1 247 Master
Byte Slave Address
Slave
Byte Function Code
Table Read
Read / Write

Function Code

Application Structure
(general)
Modbus Client (Master)
SCADA

RS-232/485

Modbus Device (Slave)

HMI

Internet
Internet

Modbus Device (Slave)

Query-Response Cycle
Query
Station Number
Function Code
Data Bytes
(Flexible)

Error Check

Station Number
Function Code
Data Bytes
(Flexible)

Error Check

Response

Two Serial Transmission Modes

ASCII Mode

Data system
ASCII character, 0~9,A~F
Bits per data unit

Error Check Field


Longitudinal Redundancy Check (LRC)

RTU Mode

Data system
8-bit Binary, 00~FF
Bits per data unit

Error Check Field


Cyclical Redundancy Check (CRC)

Modbus Message Packet

Modbus Command Response

Read Coil Status (FC=01)


Request
01 Function Code Coil On Off Coil 20 56
Slave 17
11 01 0013 0025 0E84
11 : Slave Address (17 = 11 hex )
01 : Function Code (read Coil Status)
0013 : Data Address Coil Coil 1. (Coil 20 - 1 = 19 = 13 hex )
0025 : Coil . (coils 20 to 56 = 37 = 25 hex)
0E84 : The CRC (cyclic redundancy check) for error checking.
Response
11 01 05 CD6BB20E1B 45E6
11 : Slave Address (17 = 11 hex)
01 : Function Code (read Coil Status)
05 : data bytes Coil (37 Coils / 8 bits per byte = 5 bytes )
CD : Coils 20 - 27 ( 1100 1101 ) ( 27|26|25|24 23|22|21|20)
6B : Coils 28 - 35 ( 0110 1011 )
B2 : Coils 36 - 43 ( 1011 0010 )
0E : Coils 44 - 51 ( 0000 1110 )
1B : Coils 52 - 56 ( 0001 1011 )
45E6 : The CRC (cyclic redundancy check)
Coil 36 off ( 0 ) 43 on ( 1 ) 37 Coils / 8 bits Coil 57
58 59 000

Modbus Command Response

Read Input Status (FC=02)


Request
ON/OFF Discrete inputs DI Address 10197 to
10218
slave Address 17
11 02 00C4 0016 BAA9
11 : Slave Address (17 = 11 hex )
02 : Function Code (read Input Status)
00C4 : Data Address Address 10001 (10197 - 10001 = 196 = C4 hex)
0016 : (197 218 = 22 = 16 hex)
BAA9 : CRC (cyclic redundancy check) for error checking.
Response
11 01 03 ACDB35 6418
11 : Slave Address (17 = 11 hex )
01 : Function Code (read Input Status)
03 : data bytes (22 Inputs / 8 bits per byte = 3 bytes)
AC : Discrete Inputs 10197 - 10204 ( 1010 1100 )
DB : Discrete Inputs 10205 - 10212 ( 1101 1011 )
35 : Discrete Inputs 10213 - 10218 ( 0011 0101 )
6418 : The CRC (cyclic redundancy check).
DI Address 10197 off ( 0 ) 10204 on ( 1 ) Address 10219 10220

You might also like