contents

Saturday, February 4, 2017

Basic of MODBUS





BASICS OF MODBUS

·         Modbus is a serial communication protocol published by MODICON in 1997.it was created specifically for use in MODICON PLC for industrial application today it is an open protocol used by a wide range of automation products.

·         Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in SCADA.

·         Modbus is available in

1.       Serial communication

2.       Ethernet

·         The different wiring standards to deploy Modbus in serial communication are

1.       RS232

2.       RS422

3.       RS485

·         dynamics of Modbus as master and slave in serial communication and client, server over Ethernet.

·         The three types of variations of Modbus protocols are

1.       Modbus ASC II

2.       Modbus RTU

3.       Modbus TCP/IP

·         Modbus was originally developed using ASC II characters to encode messages.

·         Modbus RTU is by for the most common implementation used widely in automation.

Modbus RTU frame format

 

address function data Error check
 

 


·         Modbus RTU devices typically use one of three electrical interfaces

RS232, RS422, RS485

·         RS232 is a simple point to point arrangement

·         If you only need to connect one device to another.

50 ft                           

15 METERSI                                                              I

SLAVEMASTER                                         

                                                                               

 To connect more than two devices on the same line, and to have a distance greater than 50 ft. RS485 or RS422 are recommended.

·         For a master communicating with multiple slave devices RS485 is by far the most popular method.

·         theRS485 standard can support up to 32 nodes. Over a range up to 4000 feet roughly 1200 meters without any repeaters.

·         The speed the Modbus messages are sent at it referred to as the baud rate (no of bits per second).

·         All devices on RTU network must use the same baud rate.

    Modbus baud rate range

           9600-19200         typical speeds

            300-100000         possible speeds

·         A Modbus serial network has a master device that issues commands to the slave devices, the slave will not transmit information unless they receive a command to do so from the master.

·         There can be only one master on a network and a maximum up247 slaves .each with a unique id from 1to 247.

 

247 Slaves Maximum
MASTER
 


                                                                                                                                               .

·         RS485 cannot drive more than 32 nodes in a single segment so in case of some rare application if more than 32 node are required then a repeater is required

MASTER,repeater,32 nodes or
Devices
 

 

 


·         writeThe master can write data to the slaves as well as read

MASTER,SLAVE,read
 

 


·         Modbus RTU network will be only formed by connecting the slaves in series or by the below daisy chain method and the cannot be connected in star or its similar topology

·         In Modbus TCP/IP Modbus devices using regular Ethernet cables and switches to communicate with each other

·         The big difference with Modbus TCP/IP is MBAP header or Modbus application header is added to the start of the each message , the slave id and crc checking is done by the lower layer(Transport layer of OSI model)

·         Modbus TCP/IP uses port502 for communication this port is important if your data needs to go through a firewall. Modbus RTU messages can also be sent as regular RTU messages encapsulated inside Ethernet TCP/IP packet. Encapsulated messages can use any port.

·         The MBAP and RTU encapsulation are not compactible device must be set one are the other

·         MBAP messaging is by far the most popular Modbus TCP/IP communication method.

·         Modbus TCP/IP

o   Modbus TCP/IP is stead of master /slave .the TCP network consist of client or server  or connected on the network using switches

o   Modbus TCP/IP devices use internet protocol addressing and require a subnet mask. The IP address the location of a particular device on a network and the subnet mask server to simplify the task of routing traffic within the network.

·         } discrete 0 or 1Modbus addressing system and different data table.

o   coil-read write                                 00001-09999

o   } numerical 16 bit valuesdiscrete inputs-read only              10001-19999

o   input registers-read only               30001-39999

o   holding registers-read/write         40001-49999

·         coils and discrete inputs=1 bit

·         register=16 bits (or) 2 Bytes (or) word

·         Modbus function codes are simple and the numerical  codes that tell the slave which table to access and whether to read or write the table

·         note: Function codes plays a major role and during the device configuration they should be properly referenced.

·         Each function codes relates to a specific  data table address range for interface function codes it is the code to read an individual bit status

·         Function codes

o   1- read coil status

o   2-read input status

o   3-read holding registers

o   4-read input registers

o   5-read single coil status

o   6-read single register

·         Modbus as a protocol does not exactly define how the data to be stored in the register

o   Different vendors have different ways of storing  and transmitting data

o   Some devices will transmit the  higher bit bit first, followed by the lower byte, others will do the other way around

o   By the same token, when registers are combined to represent32-bit real values. Some devices will transmit the higher 16bit in the first register and the 16 bits in the second register

o   eg:Int532_LW_HB

 

 

 

3 comments: