Introduction to Modbus Communication protocol

Source: Internet
Author: User

Introduction to Modbus protocol

  Modbus protocol is a common language used in electronic controller. With this protocol, the controllers can communicate between each other, the controller through the network (for example, Ethernet) and other devices. It has become a general industry standard, with it, the control equipment produced by different manufacturers can be practiced into industrial networks, centralized monitoring.

This protocol defines the message structures that a controller can recognize, regardless of what network they are communicating with. It describes the process by which a controller requests access to other devices, if it responds to requests from other devices, and how to detect errors and log them. It develops a common format for message domain patterns and content.

When communicating on a Modbus network, this protocol determines the device address that each controller needs to know, identifies messages sent by address, and determines what action to take. If a response is required, the controller generates feedback and is sent out using the Modbus protocol. On other networks, messages that contain the Modbus protocol are converted to frames or packet structures used on this network. This transformation also extends the method of addressing the node address, routing path, and error detection based on the specific network.

1, transmission on the Modbus network

The standard Modbus port is a RS-232 compatible serial interface that defines the PIN, cable, signal bit, transmit baud rate, parity of the connection port. The controller passes through the Modbus networking directly.

Controller communication uses master-slave technology, which means that only one device (the primary device) can initialize the transmission (query). Other devices (from the device) react accordingly to the data provided by the main device query. Typical main device: host and programmable meter. Typical slave device: Programmable controller.

The master device can communicate independently and from the device, as well as broadcast and all slave devices. If a message is returned from the device in response to a separate communication, no response will be made if it is queried in a broadcast manner. The Modbus protocol establishes the format of the main device query: The device (or broadcast) address, the function code, all data to be sent, and an error detection domain.

The response message from the device also has the Modbus protocol component, which includes confirming the domain to be acted on, any data to be returned, and an error detection domain. If an error occurs during message reception, or if the device cannot execute its command, the slave will establish an error message and send it as a response.

2. Transmission on other types of networks

On other networks, the controller communicates with peers, so any control can communicate with other controllers. This allows the controller to be used as a master device as well as slave devices in a separate communication process. Multiple internal channels are provided to allow simultaneous transmission.

In the message bit, the Modbus protocol provides the master-slave principle, although the network communication method is "peering". If a controller sends a message, it simply acts as the primary device and expects to get a response from the device. Similarly, when the controller receives a message, it will establish a response format from the device and return it to the sending controller.

3. Query-Response Period

  

(1) Enquiry

The function code in the query message tells you which function to perform from the device that is selected. The data segment contains any additional information from the device to perform the function. For example, function code 03 is required to read the hold registers from the device and return their contents. The data segment must include information to be told from the device: from which register to read and the number of registers to read. The error detection domain provides a way for the slave device to verify that the message content is correct.

(2) Response

If a normal response is generated from the device, the function code in the response message is the response to the function code in the query message. The data segment includes data collected from the device: like a register value or status. If an error occurs, the function code is modified to indicate that the response message is incorrect, and the data segment contains the code that describes the error message. The error detection domain allows the primary device to confirm that the message content is available.

Reference: http://www.360doc.com/content/14/0120/10/7991404_346584755.shtml

Introduction to Modbus Communication protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.