Introduction To MODBUS: Technical Tutorial
Introduction To MODBUS: Technical Tutorial
Introduction To MODBUS: Technical Tutorial
Introduction to MODBUS
Technical Tutorial
2002 12 - 06
Table of Contents
1: Introduction 2: Communication between MODBUS devices 3: MODBUS REGISTER MAP 4: Serial Transmission Modes of MODBUS networks
4.1. 4.2. ASCII Mode RTU Mode
6: MODBUS ADDRESSES 7: MODBUS FUNCTIONS 8: MODBUS DATA FIELD 9: MODBUS ERROR CHECKING
9.1. 9.2. Parity Checking Frame checking
10: MODBUS EXCEPTIONS 11: MODBUS/TCP 12: MODBUS/TCP and Sena Products 13: Conclusion
6. MODBUS ADDRESSES
The master device addresses a specific slave device by placing the 8-bit slave address in the address field of the message (RTU Mode). The address field of the message frame contains two characters (in ASCII mode), or 8 binary bits (in RTU Mode). Valid addresses are from 1-247. When the slave responds, it places its own address in this field of its response to let the master know which slave is responding.
7. MODBUS FUNCTIONS
The function code field of the message frame will contain two characters (in ASCII mode), or 8 binary bits (in RTU Mode) that tell the slave what kind of action to take. Valid function codes are from 1-255, but not all codes will apply to a module and some codes are reserved for future use.
11: MODBUS/TCP
MODBUS/TCP is a communication protocol designed to allow industrial equipment such as Programmable Logic Controllers, computers, operator panels, motors, sensors, and other types of physical input/output devices to communicate over a network. Modbus/TCP was invented by Modicon/Group Schneider and is today is one of the most popular protocols embedded inside the TCP/IP frames of Ethernet. Modbus/TCP basically embeds a Modbus frame into a TCP frame in a simple manner. This is a connection-oriented transaction, which means every query expects a response. This query/response technique fits well with the master/slave nature of Modbus, adding to the deterministic advantage that Switched Ethernet offers industrial users. The use of OPEN Modbus within the TCP frame provides a totally scaleable solution from ten nodes to ten thousand nodes without the risk of compromise that other multicast techniques would give. MODBUS TCP/IP has became an industry de facto standard because of its openness, simplicity, low cost development, and minimum hardware required to support it. At this moment there are more than 200 MODBUS TCP/IP devices available in the market. It is used to exchange information between devices, monitor and program them. It is also used to manage distributed I/Os, being the preferred protocol by the manufacturers of this type of devices. MODBUS TCP/IP uses TCP/IP and Ethernet to carry the MODBUS messaging structure. MODBUS/TCP requires a license but all specifications are public and open so there is no royalty paid for this license. Making use of TCP/IP also offers the use of embedded Web pages to make life even more user friendly! Simply `surf' your plant intranet for the information you need by using your web browser.
11.2.
TCP/IP?
MODBUS TCP/IP is simply MODBUS protocol with a TCP wrapper. It is therefore extremely simple for existing MODBUS devices to communicate over MODBUS TCP/IP. To do this a gateway device is required to convert MODBUS protocol to MODBUS TCP/IP.
13. Conclusion
MODBUS is an application layer messaging protocol, positioned at level 7 of the OSI model, that provides client/server communication between devices connected on different types of buses or networks. The industry's serial de facto standard since 1979, MODBUS continues to enable millions of automation devices to communicate. at a reserved system port 502 on the TCP/IP stack. MODBUS is used to monitor and program devices; to communicate intelligent devices with sensors and instruments; to monitor field devices using PCs and HMIs; MODBUS is also an ideal protocol for RTU applications where wireless communication is required. Today, support for the simple and elegant structure of MODBUS continues to grow. The Internet community can access MODBUS
10