SEARCH
— 葡萄酒 | 威士忌 | 白兰地 | 啤酒 —
— 葡萄酒 | 威士忌 | 白兰地 | 啤酒 —
Differences between Modbus RTU and Modbus ASCII protocols, both based on serial physical layer:
RTU stands for Remote Terminal Unit, while ASCII is the American Standard Code for Information Interchange. ASCII is a character representation format that encodes text editing symbols, uppercase and lowercase letters, numbers, and some invisible control characters. It includes 127 character codes, excluding the null character.
Modbus uses a master-slave protocol for communication. The client acts as the master, sending requests to the server, and the server (slave) responds to the master’s requests. The communication frame used is called the Application Data Unit (ADU), which includes address, function code, data, and error check segments.
The function code and data segments together are called the Protocol Data Unit (PDU). The function code occupies one byte, with values ranging from 1 to 255. Values 128-255 are reserved for exception message response frames. Function codes 1-127 are used for numbering, with 65-72 and 100-110 being user-defined codes.
a. Address field: Refers to the address of the device on the bus node. Valid addresses range from 0-247, with 0 being the broadcast address. Node device addresses can be selected from 1-247, and each address on the bus node must be unique.
b. Function code: Specifies the action to be performed by the server.
c. Data field: Contains request and response parameters.
d. Error check: The calculation result of “redundancy check” on the message content (Modbus RTU uses CRC check, Modbus ASCII uses LRC check).
The Modbus RTU communication frame consists of slave address + function code + data + CRC check. The maximum length of the data frame is 256 bytes.
In the RTU data frame, each byte of data is defined as 8 bits. Each 8-bit byte in the message contains two 4-bit hexadecimal characters (0-9, A-F).
The character transmission format is: 1 start bit + 8 data bits + 1 parity bit + 1 stop bit. During transmission, LSB is sent first, followed by MSB.
The Modbus ASCII communication frame consists of start + slave address + function code + data + LRC check + end. The maximum length of the data frame is 513 bytes.
Compared to Modbus RTU protocol, Modbus ASCII protocol has two main differences:
Modbus ASCII protocol has a start and end. In this protocol, the colon “:” is used as the start, and carriage return and line feed are used as the end.
In Modbus ASCII protocol, each byte of data is sent as two ASCII characters. For example, the data byte 0X5B would be encoded as two characters: 0X35=”5″ and 0X42=”B”, while Modbus RTU would directly send 0X5B.
Modbus TCP is essentially the same as Modbus RTU, with the main difference being that Modbus TCP protocol is transmitted over Ethernet using TCP port 502. This protocol uses TCP for the physical layer, data link layer, network layer, and transport layer. At the application layer, the Modbus protocol is modified and encapsulated into TCP.W
The receiving end unpacks the TCP data packet, retrieves the original Modbus frame, parses it according to the Modbus protocol specification, and then repackages the return data into the TCP protocol to send back to the sender.
In Modbus TCP, there is no concept of slave address; instead, devices are identified by their IP addresses.
CRC check is not used, as the TCP packet already includes a checksum to ensure data accuracy.
These are the basic differences between Modbus RTU, Modbus ASCII, and Modbus TCP protocols. Understanding these distinctions is crucial for implementing effective industrial communication systems and choosing the right protocol for specific applications in automation and IoT projects.
Cat-1 has seen tremendous development over the past couple of years and is likely familiar to those in the IoT industry. However, how does it compare to NB-IoT?
View detailsAs a technical support specialist at Yeaplink, my journey with the 4G LTE Light Industrial M2M Router began several years ago. From the moment I was introduced to this remarkable device, I knew it was something special. The 4G LTE Light Industrial...
View detailsI've been observing the telecommunications industry for decades, particularly the misconceptions about Customer Premises Equipment (CPE). Many people think CPE is just another name for a router, but they're completely wrong. Let me tell you what I...
View detailsIs PLC easy to learn? This is likely the most pressing question for many aspiring PLC learners.
View detailsMo