3 Modbus
3 Modbus
Modbus protocol
7 Application Modbus
6 Presentation
5 Session
4 Transport
3 Network
1 Physical RS485
Part 2 : Définitions
Modbus TCP/IP
7 Application Modbus
6 Préeentation
5 Session
4 Transport TCP
3 Network IP
2 Link
* CSMA / CD Carrier-sense
Modbus Plus
7 Application Modbus
6 Presentation
5 Session
4 Transport
3 Network
1 Physical RS485
Part 2 : Définitions
The main advantage of the RTU mode is that it achieves higher throughput.
The Modbus frame structure is the same for requests (master to slave
messages) and responses (slave to master messages).
Modbus RTU
Modbus ASCII
Address field
Valid slave device addresses are in the range of 0 ... 247 decimal.
The individual slave devices are assigned addresses in the range of 1 ... 247.
Value 0 is reserved for broadcast messages (no response).
Request :
A master addresses a slave by placing the slave address in the address field of
the message.
Response :
When the slave sends its response, it places its own address in this address field
of the response to let the master know which slave is responding.
Part 3 : Modbus frame description
Function field
Request :
The function code field tells the slave what kind of action to perform.
Response :
For a normal response, the slave simply echoes the original function code.
Data field
Request :
The data field contains additional information which the slave must use to take
the action defined by the function code. This can include items like register
addresses, quantity of items to be handled, etc...
Response :
If no error occurs, the data field contains the data requested.
If an error occurs, the field contains an exception code that the master
application can use to determine the next action to be taken.
Part 3 : Modbus frame description
Checksum field
Request :
The checksum is calculated by the master and sends to the slave.
Response :
The checksum is re-calculated by the slave and compared to the value sent
by the master.
If a difference is detected, the slave will not construct a response to the master.
Part 3 : Modbus frame description
Request :
Response :
Request :
Response :
Request :
Response :
Code Function
Parity checking
Even or odd can be optionally applied to each character.
Frame checking
LRC or CRC is applied to the entire message.
Continuous stream
The entire message frame must be transmitted as a continuous stream.
If a silent interval (more than 1.5 character times RTU mode or 1 second ASCII mode) occurs
before completion of the frame, the receiving device flushes the incomplete message and
assumes that the next byte will be the address field of a new message.
Part 4 : Security of transmission
This interval is set to be long enough for any slave to respond normally.
If the slave detects a transmission error, the message will not be acted upon.
The slave will not construct a response to the master.
Thus the timeout will expire and allow the master's program to handle the error.
Part 5 : Physical layer
polarisation
line terminator
distribution of a reference potential
number of slaves
length of the bus
Part 5 : Physical layer
Uni-Telway
Jbus
New Modbus RS485 standard schematic
Part 5 : Physical layer
5V
Master 650
650
D1
120 120
1 nF 1 nF
D0
Common
Slave 1 Slave 2
5V
Master 4,7 K
4,7 K
D(B)
120 120
1 nF D(A) 1 nF
0 VL
5V 5V
Slave 1 Slave 2
5V
Master
470
470
L-(B/B ’)
150 150
L+(A/A ’)
Slave 1 Slave 2
Rp
120 D1
120
1 nF D0 1 nF
Common
Maximum distance: With RS485 : 1000 m without repeater
Data rate: From 1,200 to 115 Kbits/s