Python-based communication protocol integration test method, equipment and medium
Through the Python-based communication protocol integration test method, the graphical user interface is built using the Tkinter library and supports multiple communication protocols, solving the problems of complex and cost of existing testing methods, and achieving fast and flexible communication protocol testing, ensuring the correctness and reliability of the protocol.
Patent Information
- Application Number
- CN202411757050.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The existing communication protocol testing methods are complex and costly, making it difficult to quickly verify the correctness and reliability of the protocol, and lack flexibility, making it difficult to adapt to changing testing needs.
Using Python-based communication protocol integration testing method, a graphical user interface is built through the Tkinter library, multiple communication modules are imported, and multiple communication protocols are supported. The method includes client and server parts, configuring communication addresses and parameters through a graphical interface, realizing the sending and receiving of data, and recording logs to verify test results.
The communication protocol testing process is simplified, the testing cycle is shortened, the testing flexibility and convenience are improved, the time and labor costs are reduced, and the communication protocol is ensured.
Smart Images

Figure CN119544573A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things data communication, and in particular to a communication protocol integration test method, device and medium based on Python. Background Art
[0002] In today's industrial and commercial environments, the application of IoT systems is becoming more and more widespread, playing an important role in automation, monitoring, data collection and intelligent decision-making. The core of the IoT system lies in the interconnection between its components, which relies on stable and reliable communication protocols.
[0003] In the IoT system, the communication protocol between various components is the key to ensure accurate and timely data transmission. The communication protocol defines the format, rate, error detection and correction methods of data transmission, etc. Due to the diversity and complexity of IoT systems, there are multiple communication protocols. Existing communication protocol testing methods usually rely on specific software or hardware tools, which often only support a limited number of communication protocols. This results in the need to use multiple different test tools when testing multiple communication protocols, which increases the complexity and cost of testing. In the traditional communication protocol testing process, there are many and complex communication protocols, large workload, high cost, and difficult to ensure data reliability. In addition, existing testing methods may lack flexibility and are difficult to adapt to changing testing needs.
[0004] With the development of industrial intelligence and digital transformation, the demand for integrated testing of communication protocols is growing. Therefore, how to quickly and conveniently verify the correctness and reliability of communication protocols to simplify the testing process and shorten the testing cycle is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical task of the present invention is to provide a communication protocol integrated testing method, device and medium based on Python to solve the problem of how to conveniently and quickly verify the correctness and reliability of the communication protocol, so as to simplify the testing process and shorten the testing cycle.
[0006] The technical task of the present invention is achieved in the following way: a communication protocol integration test method based on Python, which uses the Tkinter library to build a graphical user interface (GUI) and supports multiple communication protocols by importing multiple communication modules; the communication module (such as Modbus) is used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol; the details are as follows:
[0007] S1. Select the protocol and client or server type through the graphical user interface column;
[0008] S2. Determine whether it is a client or server type:
[0009] ① If it is a client type, execute steps S3 to S5;
[0010] ② If it is the server, execute steps S6 to S8;
[0011] S3. Complete the configuration of the server communication address, the parameters required for the communication protocol, the address and value of the sent data, and the log record of data sending;
[0012] S4, sending data;
[0013] S5. Determine whether to terminate the client operation:
[0014] ① If the operation is finished, execute step S9;
[0015] ② If the operation has not ended, jump to step S4;
[0016] S6. Complete the configuration of the client communication address, the parameters required for the communication protocol, the address of the received data, and the log record of the data received;
[0017] S7, receiving data;
[0018] S8. Determine whether to terminate the server operation:
[0019] ① If the operation is finished, execute step S9;
[0020] ② If the operation has not ended, jump to step S7;
[0021] S9. End.
[0022] As a preferred option, the protocol selection is as follows:
[0023] List all supported communication protocol names through the user interface;
[0024] Select the desired communication protocol from the list;
[0025] Select client or server;
[0026] Open the operation interface of the corresponding protocol client or server.
[0027] As a preferred embodiment, the client is used as the data generator and sender, as follows:
[0028] Fill in the server's IP address and port number on the configuration interface, and a connection with the server will be established based on the information filled in;
[0029] After the communication address of the server is completed, configure the parameters required by the communication protocol; the parameters required by the communication protocol include the station number and function code;
[0030] Get the template to get the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent;
[0031] Save the modified configuration locally as an ini format file;
[0032] The client starts sending data, which is formatted according to the selected communication protocol;
[0033] The data transmission log records the detailed information of each data transmission, wherein the detailed information of the data transmission includes the transmission time and the data content.
[0034] Preferably, the server acts as the receiver of the data, as follows:
[0035] Fill in the client's IP address and port number on the configuration interface, and a connection with the client will be established based on the information filled in;
[0036] After the client communication address is completed, configure the parameters required by the communication protocol; the parameters required by the communication protocol include station number and function code;
[0037] Get the template to get the data writing format example under the protocol, modify the read address, the data value type and value size to be read;
[0038] Save the modified configuration locally as an ini format file;
[0039] The server starts to receive data and formats the acquired data according to the selected communication protocol;
[0040] The data receiving log records the detailed information of each data reception, wherein the detailed information of data reception includes the time and data content.
[0041] A communication protocol integrated test system based on Python, the system comprising:
[0042] Interface building module, used to build graphical user interfaces (GUIs) using the Tkinter library;
[0043] The communication module is used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol;
[0044] The protocol selection module is used to list various communication protocol names on the graphical user interface and provide an entry for opening the communication protocol client or server;
[0045] The client, as the data generator and sender, is used to configure the server communication address, the parameters required by the communication protocol, the address and value of the sent data, and the log record of data sending;
[0046] The server, as the data receiving end, is used to configure the client communication address, the parameters required by the communication protocol, the address of the received data, and the log record of data reception.
[0047] Preferably, the protocol selection module includes:
[0048] List submodule, used to list all supported communication protocol names through the user interface list;
[0049] The communication protocol selection submodule is used to select the required communication protocol from the list;
[0050] The port selection submodule is used to select the client or server;
[0051] Open submodule, used to open the operation interface of the corresponding protocol client or server.
[0052] Preferably, the client includes:
[0053] The server-side filling submodule is used to fill in the server's IP address and port number in the configuration interface, and a connection with the server will be established based on the filled information;
[0054] The server configuration submodule is used to configure various parameters required by the communication protocol based on the completion of the server communication address; the various parameters required by the communication protocol include station number and function code;
[0055] The template acquisition submodule is used to obtain the template to obtain the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent;
[0056] The configuration saving submodule is used to save the modified configuration and save it locally as an ini format file;
[0057] The data sending submodule is used for the client to start sending data and format the data according to the selected communication protocol;
[0058] The sending log recording submodule is used to record the detailed information of each data sending through the data sending log; wherein the detailed information of the data sending includes the sending time and the data content.
[0059] Preferably, the server includes:
[0060] The client filling submodule is used to fill in the client's IP address and port number in the configuration interface, and a connection with the client will be established based on the filled in information;
[0061] The client configuration submodule is used to configure various parameters required by the communication protocol based on the client communication address. The parameters required by the communication protocol include station number and function code.
[0062] Modify the submodule to obtain the template to obtain the data writing format example under the protocol, modify the reading address, the data value type and value size to be read;
[0063] The local save submodule is used to save the modified configuration and save it locally as an ini format file;
[0064] The data receiving submodule is used for the server to start receiving data and format the obtained data according to the selected communication protocol;
[0065] The receiving log recording submodule is used to record the detailed information of each data reception through the data receiving log; wherein the detailed information of the data reception includes the time and the data content.
[0066] Preferably, the system tests a Modbus TCP communication protocol in the following working process:
[0067] The first step is to start the test software, open the communication protocol integrated test software written in Python, and operate it through the GUI interface built by the Tkinter library;
[0068] Step 2: Select "Modbus TCP" as the communication protocol for the test in the protocol selection interface, and click the "Start Client" or "Start Server" button;
[0069] The third step is client configuration, as follows:
[0070] ①Server communication address configuration: Enter the server IP address as "192.168.1.10" and the port number as "502" in the client interface;
[0071] ②Communication protocol parameter configuration: configure the parameter station number of Modbus TCP to "1" and the function code to "3";
[0072] ③Data sending configuration: Set the data address to be sent to "0x01" and the data value to "0x0A" (indicating 10);
[0073] ④Data sending log record: automatically record the details of the sent data packet, including sending time, data content data value, and sending status "successful";
[0074] If no stop signal is detected, data transmission continues;
[0075] The fourth step is server configuration, as follows:
[0076] ①Client communication address configuration: Enter the server IP address as "192.168.1.20" and the port number as "502" in the server interface. The server will automatically listen to all connection requests from the client.
[0077] ②Communication protocol parameter configuration: The server configures the corresponding parameters according to the Modbus TCP protocol requirements;
[0078] ③Data receiving configuration: The server sets the address range of receiving data to "0x01" to "0x10";
[0079] ④Data receiving log record: record the details of the received data packet, including receiving time, data value: "0x0A", receiving status "success";
[0080] If no stop signal is detected, data reception continues;
[0081] The fifth step is to verify the test results, as follows:
[0082] Check the data sending status through the client's log records;
[0083] Verify data reception through server-side log records;
[0084] If data sending and receiving are successful, it means that the Modbus TCP communication protocol works properly in the corresponding test environment.
[0085] The Python-based communication protocol integrated testing method, device and medium of the present invention have the following advantages:
[0086] (1) The present invention is applicable to relatively complex IoT system application scenarios, and is used to solve the problems of multiple and complex communication protocols, large workload, high cost, and difficulty in ensuring data reliability in the traditional communication protocol testing process;
[0087] (ii) The present invention includes two parts: a communication master station and a slave station: the master station configures the communication address and parameters, inquires the slave station about the data it wants to read, the slave station receives the signal and replies to the master station data, and the master station receives the data and prints the log content; and each communication protocol has a corresponding master station and slave station, integrating various communication protocols, effectively solving the time cost and manpower cost brought about in the test process;
[0088] (III) The present invention aims to facilitate software methods for verifying the correctness and reliability of communication protocols. It can help testers ensure that their communication protocols can work as expected and meet the stability requirements of the system; at the same time, it can simplify the testing process and shorten the testing cycle, greatly improving convenience and practicality;
[0089] (iv) The present invention integrates the communication protocols, freeing up the human resources for separate search and testing, simplifying the testing process, and greatly shortening the communication test cycle;
[0090] (V) Previously, only a single protocol communication method had to be found, and various usage methods had to be understood. However, the present invention can support multiple communication protocols, greatly improving convenience and practicality;
[0091] (VI) The present invention can freely set the communication address, protocol parameters, data address, and data value, thereby improving the flexibility of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] The present invention is further described below in conjunction with the accompanying drawings.
[0093] Attached Figure 1 This is a flowchart of the Python-based communication protocol integration test method. DETAILED DESCRIPTION
[0094] The Python-based communication protocol integrated testing method, device and medium of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments of the specification.
[0095] Embodiment 1:
[0096] As attached Figure 1 As shown, this embodiment provides a communication protocol integration test method based on Python, which uses the Tkinter library to build a graphical user interface (GUI) and supports multiple communication protocols by importing multiple communication modules; the communication module is used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol; the details are as follows:
[0097] S1. Select the protocol and client or server type through the graphical user interface column;
[0098] S2. Determine whether it is a client or server type:
[0099] ① If it is a client type, execute steps S3 to S5;
[0100] ② If it is the server, execute steps S6 to S8;
[0101] S3. Complete the configuration of the server communication address, the parameters required for the communication protocol, the address and value of the sent data, and the log record of data sending;
[0102] S4, sending data;
[0103] S5. Determine whether to terminate the client operation:
[0104] ① If the operation is finished, execute step S9;
[0105] ② If the operation has not ended, jump to step S4;
[0106] S6. Complete the configuration of the client communication address, the parameters required for the communication protocol, the address of the received data, and the log record of the data received;
[0107] S7, receiving data;
[0108] S8. Determine whether to terminate the server operation:
[0109] ① If the operation is finished, execute step S9;
[0110] ② If the operation has not ended, jump to step S7;
[0111] S9. End.
[0112] The protocol selection in this embodiment is as follows:
[0113] List all supported communication protocol names through the user interface;
[0114] ①Select the required communication protocol from the list;
[0115] ②Select client or server;
[0116] ③Open the operation interface of the corresponding protocol client or server.
[0117] The client in this embodiment is used as the data generation and transmission end, and the details are as follows:
[0118] ① Fill in the IP address and port number of the server in the configuration interface, and a connection with the server will be established based on the information filled in;
[0119] ② Based on the communication address of the server, configure the parameters required by the communication protocol; the parameters required by the communication protocol include station number and function code;
[0120] ③ Obtain the template to obtain the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent;
[0121] ④Save the modified configuration locally as an ini format file;
[0122] ⑤The client starts sending data and formats the data according to the selected communication protocol;
[0123] ⑥ Record detailed information of each data transmission through the data transmission log; wherein, the detailed information of data transmission includes transmission time and data content.
[0124] The server in this embodiment serves as the data receiving end, and is specifically as follows:
[0125] ① Fill in the client's IP address and port number in the configuration interface, and a connection with the client will be established based on the information filled in;
[0126] ② Based on the client communication address, configure the parameters required by the communication protocol; the parameters required by the communication protocol include station number and function code;
[0127] ③ Get the template to get the data writing format example under the protocol, modify the reading address, the data value type and value size to be read;
[0128] ④Save the modified configuration locally as an ini format file;
[0129] ⑤The server starts to receive data and formats the obtained data according to the selected communication protocol;
[0130] ⑥ Record detailed information of each data reception through the data reception log; the detailed information of data reception includes time and data content.
[0131] Embodiment 2:
[0132] This embodiment provides a communication protocol integrated testing system based on Python, the system comprising:
[0133] Interface building blocks, with
[0134] Use the Tkinter library to build graphical user interfaces (GUIs);
[0135] Modbus communication module, used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol;
[0136] The protocol selection module is used to list various communication protocol names on the graphical user interface and provide an entry for opening the communication protocol client or server;
[0137] The client, as the data generator and sender, is used to configure the server communication address, the parameters required by the communication protocol, the address and value of the sent data, and the log record of data sending;
[0138] The server, as the data receiving end, is used to configure the client communication address, the parameters required by the communication protocol, the address of the received data, and the log record of data reception.
[0139] The protocol selection module in this embodiment includes:
[0140] List submodule, used to list all supported communication protocol names through the user interface list;
[0141] The communication protocol selection submodule is used to select the required communication protocol from the list;
[0142] The port selection submodule is used to select the client or server;
[0143] Open submodule, used to open the operation interface of the corresponding protocol client or server.
[0144] The client in this embodiment includes:
[0145] The server-side filling submodule is used to fill in the server's IP address and port number in the configuration interface, and a connection with the server will be established based on the filled information;
[0146] The server configuration submodule is used to configure various parameters required by the communication protocol based on the completion of the server communication address; the various parameters required by the communication protocol include station number and function code;
[0147] The template acquisition submodule is used to obtain the template to obtain the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent;
[0148] The configuration saving submodule is used to save the modified configuration and save it locally as an ini format file;
[0149] The data sending submodule is used for the client to start sending data and format the data according to the selected communication protocol;
[0150] The sending log recording submodule is used to record the detailed information of each data sending through the data sending log; wherein the detailed information of the data sending includes the sending time and the data content.
[0151] The server in this embodiment includes:
[0152] The client filling submodule is used to fill in the client's IP address and port number in the configuration interface, and a connection with the client will be established based on the filled in information;
[0153] The client configuration submodule is used to configure various parameters required by the communication protocol based on the client communication address. The parameters required by the communication protocol include station number and function code.
[0154] Modify the submodule to obtain the template to obtain the data writing format example under the protocol, modify the reading address, the data value type and value size to be read;
[0155] The local save submodule is used to save the modified configuration and save it locally as an ini format file;
[0156] The data receiving submodule is used for the server to start receiving data and format the obtained data according to the selected communication protocol;
[0157] The receiving log recording submodule is used to record the detailed information of each data reception through the data receiving log; wherein the detailed information of the data reception includes the time and the data content.
[0158] The working process of this system testing a Modbus TCP communication protocol is as follows:
[0159] The first step is to start the test software, open the communication protocol integrated test software written in Python, and operate it through the GUI interface built by the Tkinter library;
[0160] Step 2: Select "Modbus TCP" as the communication protocol for the test in the protocol selection interface, and click the "Start Client" or "Start Server" button;
[0161] The third step is client configuration, as follows:
[0162] ①Server communication address configuration: Enter the server IP address as "192.168.1.10" and the port number as "502" in the client interface;
[0163] ②Communication protocol parameter configuration: configure the parameter station number of Modbus TCP to "1" and the function code to "3";
[0164] ③Data sending configuration: Set the data address to be sent to "0x01" and the data value to "0x0A" (indicating 10);
[0165] ④Data sending log record: automatically record the details of the sent data packet, including sending time, data content data value, and sending status "successful";
[0166] If no stop signal is detected, data transmission continues;
[0167] The fourth step is server configuration, as follows:
[0168] ①Client communication address configuration: Enter the server IP address as "192.168.1.20" and the port number as "502" in the server interface. The server will automatically listen to all connection requests from the client.
[0169] ②Communication protocol parameter configuration: The server configures the corresponding parameters according to the Modbus TCP protocol requirements;
[0170] ③Data receiving configuration: The server sets the address range of receiving data to "0x01" to "0x10";
[0171] ④Data receiving log record: record the details of the received data packet, including receiving time, data value: "0x0A", receiving status "success";
[0172] If no stop signal is detected, data reception continues;
[0173] The fifth step is to verify the test results, as follows:
[0174] Check the data sending status through the client's log records;
[0175] Verify data reception through server-side log records;
[0176] If data sending and receiving are successful, it means that the Modbus TCP communication protocol works properly in the corresponding test environment.
[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A communication protocol integration test method based on Python, characterized in that: The method is to use the Tkinter library to build a graphical user interface and implement support for multiple communication protocols by importing multiple communication modules; the communication module is used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol; the details are as follows: S1. Select the protocol and client or server type through the graphical user interface column; S2. Determine whether it is a client or server type: ① If it is a client type, execute steps S3 to S5; ② If it is the server, execute steps S6 to S8; S3. Complete the configuration of the server communication address, the parameters required for the communication protocol, the address and value of the sent data, and the log record of data sending; S4, sending data; S5. Determine whether to terminate the client operation: ① If the operation is finished, execute step S9; ② If the operation has not ended, jump to step S4; S6. Complete the configuration of the client communication address, the parameters required for the communication protocol, the address of the received data, and the log record of the data received; S7, receiving data; S8. Determine whether to terminate the server operation: ① If the operation is finished, execute step S9; ② If the operation has not ended, jump to step S7; S9. End.
2. The communication protocol integration test method based on Python according to claim 1, characterized in that: The protocol selection is as follows: List all supported communication protocol names through the user interface; Select the desired communication protocol from the list; Select client or server; Open the operation interface of the corresponding protocol client or server.
3. The communication protocol integration test method based on Python according to claim 1, characterized in that: The client is the data generator and sender, as follows: Fill in the server's IP address and port number on the configuration interface, and a connection with the server will be established based on the information filled in; After the communication address of the server is completed, configure the parameters required by the communication protocol; the parameters required by the communication protocol include the station number and function code; Get the template to get the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent; Save the modified configuration locally as an ini format file; The client starts sending data, which is formatted according to the selected communication protocol; The data transmission log records the detailed information of each data transmission, wherein the detailed information of the data transmission includes the transmission time and the data content.
4. The communication protocol integration test method based on Python according to any one of claims 1-3, characterized in that: The server is the receiver of the data, as follows: Fill in the client's IP address and port number on the configuration interface, and a connection with the client will be established based on the information filled in; After the client communication address is completed, configure the parameters required by the communication protocol; the parameters required by the communication protocol include station number and function code; Get the template to get the data writing format example under the protocol, modify the read address, the data value type and value size to be read; Save the modified configuration locally as an ini format file; The server starts to receive data and formats the acquired data according to the selected communication protocol; The data receiving log records the detailed information of each data reception, wherein the detailed information of data reception includes the time and data content.
5. A communication protocol integrated test system based on Python, characterized in that: The system includes: Interface building module, used to build graphical user interfaces using the Tkinter library; The communication module is used to handle the underlying interaction with different communication protocols to ensure that data can be correctly transmitted according to the established protocol; The protocol selection module is used to list various communication protocol names on the graphical user interface and provide an entry for opening the communication protocol client or server; The client, as the data generator and sender, is used to configure the server communication address, the parameters required by the communication protocol, the address and value of the sent data, and the log record of data sending; The server, as the data receiving end, is used to configure the client communication address, the parameters required by the communication protocol, the address of the received data, and the log record of data reception.
6. The Python-based communication protocol integrated test system according to claim 5, characterized in that: The protocol selection module includes: List submodule, used to list all supported communication protocol names through the user interface list; The communication protocol selection submodule is used to select the required communication protocol from the list; The port selection submodule is used to select the client or server; Open submodule, used to open the operation interface of the corresponding protocol client or server.
7. The Python-based communication protocol integrated test system according to claim 5, characterized in that: The client includes: The server-side filling submodule is used to fill in the server's IP address and port number in the configuration interface, and a connection with the server will be established based on the filled information; The server configuration submodule is used to configure various parameters required by the communication protocol based on the completion of the server communication address; the various parameters required by the communication protocol include station number and function code; The template acquisition submodule is used to obtain the template to obtain the data writing format example under the corresponding protocol, modify the storage address, the data value type and value size to be sent; The configuration saving submodule is used to save the modified configuration and save it locally as an ini format file; The data sending submodule is used for the client to start sending data and format the data according to the selected communication protocol; The sending log recording submodule is used to record the detailed information of each data sending through the data sending log; wherein the detailed information of the data sending includes the sending time and the data content.
8. The Python-based communication protocol integrated test system according to claim 5, characterized in that: The server includes: The client filling submodule is used to fill in the client's IP address and port number in the configuration interface, and a connection with the client will be established based on the filled in information; The client configuration submodule is used to configure various parameters required by the communication protocol based on the client communication address. The parameters required by the communication protocol include station number and function code. Modify the submodule to obtain the template to obtain the data writing format example under the protocol, modify the reading address, the data value type and value size to be read; The local save submodule is used to save the modified configuration and save it locally as an ini format file; The data receiving submodule is used for the server to start receiving data and format the obtained data according to the selected communication protocol; The receiving log recording submodule is used to record the detailed information of each data reception through the data receiving log; wherein the detailed information of the data reception includes the time and the data content.
9. The Python-based communication protocol integrated test system according to any one of claims 5-8, characterized in that: The working process of this system testing a Modbus TCP communication protocol is as follows: The first step is to start the test software, open the communication protocol integrated test software written in Python, and operate it through the GUI interface built by the Tkinter library; Step 2: Select "Modbus TCP" as the communication protocol for the test in the protocol selection interface, and click the "Start Client" or "Start Server" button; The third step is client configuration, as follows: ①Server communication address configuration: Enter the server IP address as "192.168.1.10" and the port number as "502" in the client interface; ②Communication protocol parameter configuration: configure the parameter station number of Modbus TCP to "1" and the function code to "3"; ③Data sending configuration: Set the data address to be sent to "0x01" and the data value to "0x0A"; ④Data sending log record: automatically record the details of the sent data packet, including sending time, data content data value, and sending status "success"; If no stop signal is detected, data transmission continues; The fourth step is server configuration, as follows: ①Client communication address configuration: Enter the server IP address as "192.168.1.20" and the port number as "502" in the server interface. The server will automatically listen to all connection requests from the client. ②Communication protocol parameter configuration: The server configures the corresponding parameters according to the Modbus TCP protocol requirements; ③Data receiving configuration: The server sets the address range of receiving data to "0x01" to "0x10"; ④Data receiving log record: record the details of the received data packet, including receiving time, data value: "0x0A", receiving status "success"; If no stop signal is detected, data reception continues; The fifth step is to verify the test results, as follows: Check the data sending status through the client's log records; Verify data reception through server-side log records; If data sending and receiving are successful, it means that the Modbus TCP communication protocol works properly in the corresponding test environment.
Citation Information
Patent Citations
Mcok testing method and system, electronic equipment and readable storage medium
CN110162464A
Rapid test method for industrial control protocol fine-grained control
CN110618942A
Equipment for transmitting industrial protocol flow message
CN111107100A
WI-FI-based universal multi-protocol digital instrument internet-of-things module
CN113242534A
Industrial communication middleware based on TCP / IP and use method thereof
CN113259404A