Sei sulla pagina 1di 4

MODBUS

Modbus was serial communication protocol developed by Modicon in 1979. Today it is an open protocol
used by a wide range of automation products.

1. Modbus over serial master and slave network


2. Modbus over Ethernet client and server network

There are 3 modbus variations

1. ASCII Modbus is originally developed in ASCII codes


2. RTU Modbus RTU is most commonly used, its in binary coding and CRC error checking
3. TCP/IP

Modbus RTU is typically used in building management system (BMS) and industrial automation system
(IAS). Modbus RTU (Serial) typically use the following 3 electrical interfaces (Different wiring standards)

1. RS-232 point-to-point arrangement (only can have 1 master and 1 slave), less than 15m
2. RS-485 most commonly used Modbus RTU
1 master with 32 slaves, 1,200m without repeater.
The speed that the Modbus sent is in baud rate (bits per second), all the devices on the same
RTU network must use the same baud rate (typical speeds: 9,600-19,200, possible speeds: 300-
100,000+).
Master will transmit commands to the slave devices; slaves will not transmit information to the
master unless they receive a command to do so by the master.
RTU only has 1 master and a maximum of 247 slaves.
Since RS-485 cannot drive more than 32 nodes in a segment, and hence 32 devices.
Unless more than 32 nodes are required, then a repeater shall be used.
A master can read/write data from/to the slaves.
Example SCADA/HMI system will be the master communicating with a series of slave devices.
Modbus RTU network must be connected in daisy chain network, they cannot be connected in
star network.
3. RS-422 Similar to RS-485, 1 master with multiple slaves
Modbus over Ethernet (TCP/IP), uses Ethernet and switches to communicate with each other. Ethernet
has 3 hardware: Ethernet card, Ethernet cable and Ethernet hub/router.

The big difference between Modbus TCP/IP and Modbus RTU is that Modbus Application Header
(MBAP) is added to the start of each message.

Modbus RTU: Slave ID-Function Code-Data-CRC

Modbus RTU messages


Start Slave ID (Address) Function Code Data CRC Check End
3.5 char 8 bits 8 bits N x 8 bits 16 bits 3.5 char

Modbus TCP/IP: MBAP-Function Code-Data (MBAP contains all the info to route to the address devices)

Modbus TCP/IP uses port 502 for data communication.


Modbus messages can be set as Modbus RTU messages encapsulated in Modbus Ethernet packet.
Encapsulated messages can use any port.
Note that MBAP messaging and encapsulated messaging are not compatible, devices must be set to use
one or the other.
MBAP messaging is by far the most popular communication method.
Modbus TCP/IP uses the term client and server instead of master and slave.
Modbus TCP/IP devices use internet protocol addressing (IP address: 000.000.000.000) and require a
subnet mask (000.000.000.000), default gateway is optional.
IP address is the location of a particular devices on the network, while subnet mask serves to simplify
the task of routing traffic within the network

Modbus addresses have 2 tables store simple discrete values (coils and discrete inputs, both are 1 bit
values, that basically means on and off), and 2 tables store numerical 16 bits values (input and holding
registers). Each table has 9,999 addresses.

1. Coils read/write, address 00001-09999


2. Discrete inputs read only, address 10001-19999
3. Input registers read only, address 30001-39999
4. Holding registers read/write, address 40001-49999

Modbus function codes are simple numerical codes that tell the slaves which table to access, whether to
read or write to that table.

1 Read coil status


2 Read input status
3 Read holding registers
4 Read input registers
5 Write single coil status
6 Write single register
15 Multiple coil write
16 Multiple register write
GENERAL PACKET RADIO SERVICE (GPRS)

GPRS is also known as 2.5G, the purpose is to provide increased data rates on the existing 2G GSM
network. First use of packet switching on GSM which was exclusively circuit switched network. Uses
coding schemes CS1, CS2, CS3, CS4 to improve data rates.

GSM 22.8kbps for user data + error correction bits. At GSM CS4, typical user data rate is 9.6kbps

CS4 21.4kbps for user data, other bits are used as data correction
CS3 15.6kbps for user data, other bits are used as data correction
CS2 13.4kbps for user data, other bits are used as data correction
CS1 9.05kbps for user data, other bits are used as data correction

Theoretical vs. actual user data rates. Maximum data rate for CS4 is 21.4kbps, 8 time slots assigned to a
user means 8 x 21.4 =171.2kbps (theoretical). Actual data rate depends upon number of data users in
cell, propagation condition in cells, and distance from BTS.
COMMUNICATION PROTOCOLS

1. Describes the rules that govern the transmission of data over the communication network.
2. Provide a method for orderly and efficient exchange of data between the sender and the
receiver.
3. It is a set of rules governing the format and meaning of frames, packets, or messages that are
exchanged by peer entities within a layer
4. Protocols are normally defined in a layered manner and provide all or part of the services
specified by a layer of the OSI reference model
5. Protocol are used for communications between entities in a system
6. Entities use protocols in order to implement their service definitions
7. Communications protocol is a system of digital rules for message exchange within

Roles of communication protocols

1. Data sequencing to detect loss or duplicate packets


2. Data routing to find the most efficient path between source and a destination
3. Data formatting defines group of bits within packet which constitutes data, control, addressing
and other information
4. Flow control ensures resource sharing and protection against traffic congestion by regulating
the flow of data on communication lines
5. Error control detect errors in messages, method for correcting errors is to re-transmit the
erroneous message block
6. Precedence and order of transmission condition all nodes about when to transmit their data
and when to receive data from other nodes. Gives equal chance for all the nodes to use the
communication channel
7. Connection establishment and termination
8. Data security prevents access of data by unauthorized users

Potrebbero piacerti anche