1. Instruction
The Modbus is a request-response protocol based on master/slave or client/server architecture. In the master-slave relationship, communication always occurs in pairs. One device must initiate a request and then wait for a response. The initiating device (named as master device) is responsible for initiating each interaction. Usually, the master device is an HMI or SCADA system, and the slave device is a sensor, programmable logic controller (PLC) or programmable automatic controller (PAC). In a standard Modbus network, there is one Master and up to 247 Slaves. Each slave has a unique Slave Address from 1 to 247.
2. Modbus Protocol
At present, the modbus protocol mainly used for serial port and Ethernet version. For serial port connections, there are two protocols as modbus RTU and mobus ASCII, which are slightly different in data and protocol details. For Ethernet connections such as modbus TCP, it does not require verification and computation.
2.1 Modbus Data Transmission Modes
1) Modbus RTU
It’s used for serial communication and makes use of the compact binary data to represent protocol communication. The RTU format follows the commands/data with a cyclic redundancy check checksum as an error check mechanism to ensure the reliability of data. Modbus RTU is the most common implementation available for Modbus. A Modbus RTU message must be transmitted continuously without inter-character hesitations. Modbus messages are framed (separated) by idle (silent) periods.
2) Modbus ASCII
It is used for serial communication and makes use of ASCII characters for protocol communication. The ASCII format uses a longitudinal redundancy check checksum. Modbus ASCII messages are framed by leading colon (":") and trailing newline (CR/LF).
3) Modbus TCP
It is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require checksum calculation, as lower layers already provide checksum protection.
2.2 Difference during Modbus ASCII, RTU and TCP
Modbus RTU and Modbus ASCII talk the same protocol. The only difference is that the bytes being transmitted over the wire are presented as binary with RTU and as readable ASCII with ASCII. It’s important to note about RTU is that the RTU message does not have a Start_of_text indication. The receiving party in the communications uses a "silent" time in order to determine the start of a new message. ASCII does have a start-of-text token. Binary messages are shorter than ASCII and therefore theoretically faster to transmit/receive.
Modbus TCP is basically a Modbus RTU protocol using the TCP interface in Ethernet network. The Modbus data structure is defined using the application layer used in the TCP/IP protocol. The TCP protocol, is used to ensure data is received and sent correctly, and the IP is the address and routing information. Modbus TCP command is a Modbus RTU command included in an Ethernet TCP/IP wrapper. The advantage of Modbus TCP is using of the existing Ethernet equipments which are widely deployed and cost effective.
3. Modbus Applications in Wlink devices
-- The end