Method of applying modbus RTU protocol on tcp/ip network
An IP network and protocol technology, applied in the bus network, data exchange through path configuration, electrical components, etc., can solve the problems of distinguishing two frames, difficult to implement Modbus RTU protocol application, unable to use time gap, etc., to achieve stable application effect. Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0039] like figure 1 As shown, the method for applying 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 server read...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 