Method for transmitting Modbus RTU protocol on TCP/IP network

An IP network and protocol technology, applied in the field of communication, can solve the problems of distinguishing between two frames, the difficulty of realizing ModbusRTU protocol transmission, and the inability to use time gaps, etc., to achieve a stable transmission effect

Inactive Publication Date: 2014-01-29
上海爱控自动化设备有限公司
View PDF4 Cites 20 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, due to the characteristics of the TCP/IP network itself, it is impossible to use the time gap to distinguish two frames, and Modbus RTU is not designed for the TCP/IP network. In the field of the protocol itsel

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for transmitting Modbus RTU protocol on TCP/IP network
  • Method for transmitting Modbus RTU protocol on TCP/IP network
  • Method for transmitting Modbus RTU protocol on TCP/IP network

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0039] Such as figure 1 As shown, the method for transmitting the Modbus RTU protocol on a TCP / IP network, which includes a client and a server in the TCP / IP network, includes the following steps:

[0040] In step S0, the server starts monitoring on a socket port, and the client establishes a connection to the socket port to start communication.

[0041] Step S1, the client sends a request to the server, the request includes several request frames, and waits for the server to respond.

[0042] Step S2, the server side receives the request frames sequentially, for each request frame:

[0043] The server reads the first byte of the current request frame and obtains the address of the slave station;

[0044] The server reads the next byte of the current request frame to obtain the function code;

[0045] Judge the byte length of the data area of ​​the current request frame according to the function code; if the byte length of the data area of ​​the request frame is N, the serv...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for transmitting a Modbus RTU protocol on a TCP/IP network. The TCP/IP network comprises a client side and a server side. The method comprises the following steps that in terms of each request frame, first two bytes are read firstly, the byte length in a data zone of the current request frame is judged according to a function code, and the content of the data zone is obtained by the server side; next two bytes of the current request frame are read by the server side, so that a CRC code is obtained; in terms of each response frame, first two bytes are read firstly, the byte length in a data zone of the current response frame is judged according to a function code, and the content of the data zone is obtained by the client side; next two bytes of the current response frame are read by the client side, so that a CRC code is obtained. The method for transmitting the Modbus RTU protocol on the TCP/IP network has the following advantages that transmission of the Modbus RTU protocol on the TCP/IP network is achieved, and the transmission effect is stable; the size of bytes of each frame is inferred according to the function code of the frame in the Modbus RTU protocol, the size of each frame can be accurately judged, and the finish of each frame can be effectively identified.

Description

technical field [0001] The invention belongs to the technical field of communication, and in particular relates to a method for transmitting the Modbus RTU protocol on a TCP / IP network. Background technique [0002] The industrial standard Modbus protocol is widely used in the communication mode of the industrial field. The Modbus protocol has two formats, namely: Modbus RTU and Modbus TCP / IP. The former is used in scenarios such as 485 serial bus, and the latter is used in a TCP / IP network environment. However, due to special requirements, in some cases it is necessary to transmit the protocol data in Modbus RTU format under the TCP / IP network. However, because the Modbus RTU format and the TCP / IP network have their own characteristics and are not compatible with each other, the Modbus RTU protocol has not been implemented at present. Efficient method for transmission under TCP / IP network. [0003] Modbus is a communication protocol in units of frames, where the format of...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L29/06H04L12/40
Inventor 杨新宇邓刚蔡志康赵瑞胡献
Owner 上海爱控自动化设备有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products