Profound and Detailed
2022-09-21
When communicating on a Modbus network, this protocol determines that each controller must know their device address, identify messages sent by address, and decide what action to take. If a response is required, the controller will generate a feedback message and send it using the Modbus protocol. On other networks, messages containing the Modbus protocol are converted to frames or packet structures used on this network. This transformation also extends the method of node address, routing path and error detection based on specific network.
1. Transfer on Modbus network
The standard Modbus port uses an RS-232C compatible serial interface, which defines the pin, cable, signal bit, transmission baud rate and parity of the connection port. The controller can network directly or via Modem. Controller communication uses master slave technology, that is, only one device (master device) can initiate transmission (query). Other devices (slave devices) make corresponding responses according to the data provided by the master device query. Typical main equipment: mainframe and programmable instrument. Typical auxiliary equipment.
Standby: programmable controller.
The master device can communicate with the slave device independently, or with all the slave devices in the broadcast mode. In case of separate communication, the slave device returns a message as a response. If the query is made in broadcast mode, no response will be made. Modbus protocol establishes the format of main device query: device (or broadcast) address, function code, all data to be sent, and an error detection domain.
The slave response message is also composed of Modbus protocol, including the domain to confirm the action, any data to return, and an error detection domain. If an error occurs during message reception, or the slave device cannot execute its command, the slave device will create an error message and send it as a response.
2. Transfer to other networks on other types of networks, and the controller uses peer-to-peer technology to communicate, so any control can initially communicate with other controllers. In this way, the controller can be used as both the master device and the slave device in the separate communication process. Multiple internal channels are provided to allow simultaneous transmission processes.
In the message bit, the Modbus protocol still provides the master-slave principle, although the network communication method is "peer to peer". If a controller sends a message, it only acts as the master device and expects a response from the slave device. Similarly, when the controller receives a message, it will establish a slave device response format and return it to the sending controller.
3. Query response cycle
(1) Query the function code in the query message to tell the selected slave what function to perform. The data segment contains any additional information to be performed by the slave device. For example, function code 03 requires the device to read the holding registers and return their contents. The data segment must contain.
Information about the slave device: where to start reading and the number of registers to be read. The error detection domain provides.
The method to verify whether 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 of the function code in the query message. The data segment contains data collected from the device, such as register values or states. If an error occurs, the function code will be modified for Indicates that the response message is incorrect, and the data section contains a code that describes this error message. The error detection domain allows the master device to confirm whether the message content is available.
<< Previous page
Next page >>