Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Marcelo Garcia T
MODBUS
Modbus.org :
http://www.modbus.org
Modicon site for Modbus users.
Transparent Factory :
http://www.transparentfactory.com
Schneider Electric site for Transparent Factory users.
Modbus Plus :
http://www.modicon.com/techpubs/toc6.html
Modbus Plus Planning and installation.
es pblico.
su implementacin es fcil y requiere poco desarrollo.
maneja bloques de datos sin suponer restricciones.
Introduccin
RS-232/485
HMI
Interne
t
Query
Station Number
Function Code
Data Bytes
(Flexible)
Error Check
Station Number
Function Code
Data Bytes
(Flexible)
Error Check
Response
Query-Response Cycle
P.5
MODBUS
7 Application
Modbus
6 Presentation
5
Session
4 Transport
3
Network
2 Link
1 Physical
RS485
7 Application
Modbus
6 Preentation
5
Session
4 Transport
3
Network
2 Link
1 Physical
TCP
IP
CSMA / CD
ETHERNET V2 ou 802.3
10
11
12
13
14
Capa de Enlace
15
Address
Function
Data
Checksum
silence
Modbus ASCII
:
3A Hex
Address
Function
Data
Checksum
CR LF
0D Hex 0A Hex
Address Function
Data
Checksum
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.
Address Function
Data
Checksum
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.
For an exception response, the slave returns a code that is equivalent to
the original function code with its most significant bit set to a logic 1.
Data field
Address Function
Data
Checksum
The data field contains additional information which the slave must use to tak
the action defined by the function code. This can include items like register
addresses, quantity of items to be handled, etc...
Response :
Address Function
Data
Checksum
Request :
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.
1 byte
2 bytes
2 bytes
2 bytes
Response :
1 byte
1 byte
2 bytes
2 bytes
2 bytes
2 bytes
Value of the
last word
CRC16
ASCII Mode
RTU Mode
1 Char
Start
Start
Modbus
Plus network 1 Char
3.5 Char 1 Char
Silence
CRC
Silence
01:
02:
03:
04:
05:
06:
15:
16:
P.24
Code
Type
01
02
03
04
05
06
07
08
11
12
15
16
17
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.