Automated testing system and method

The automated testing system solves the problems of inefficiency and human error in OPC DA testing, realizes an efficient and accurate test process, optimizes the detection point search and result recording, and improves the efficiency and accuracy of the test.

CN119493707BActive Publication Date: 2025-08-12BEIJING CONSEN AUTOMATION CONTROL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411530148.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-08-12
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

Traditional OPC DA testing methods rely on manual operations, are inefficient and prone to errors, and are difficult to meet the needs of efficient testing. Manual testing has difficulty finding test points and human errors.

Method used

It provides an automated testing system, including project download module, service configuration module, client configuration module, client data reading module and client data writing module, automatically completes the test process, writes the client program to read and write data and judge the results, and logs the test results.

Benefits of technology

It improves the accuracy and reliability of the test, significantly improves the testing efficiency and operation convenience, reduces errors caused by manual operations, and meets the high-quality and efficient testing needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493707B_ABST
    Figure CN119493707B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated testing system and method, which comprises: a project downloading module, for downloading a configured project to a controller and running the controller; a service configuration module, for automatically configuring a server-side program and starting the service of the server-side program; a client configuration module, for automatically configuring the client program; a client data reading module, for automatically reading data from the server-side program after upper computer monitoring software writes data, and judging whether the read data meets the reading expectation, so as to obtain a reading test result; a client data writing module, for automatically writing data to the server-side program, and after the server-side program receives the written data, reading the written data through the upper computer monitoring software, and judging whether the written data meets the writing expectation, so as to obtain a writing test result; the system improves the efficiency, accuracy, reliability and convenience of the test, thereby meeting the high-quality and high-efficiency testing requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and more particularly, to an automated testing system and method. Background Art

[0002] The Open Platform Communication Data Access (OPC DA) protocol is widely used in industrial automation systems to exchange data between different devices. Due to the complexity and implementation variability of the OPC DA protocol, comprehensive and accurate testing is crucial.

[0003] Traditional OPC DA testing methods usually include the following steps: Figure 1 As shown:

[0004] 1. Project configuration and downloading: configure the measurement point project and download it to the controller, and run the controller;

[0005] 2.OPC DA service configuration: set the communication IP, import the point table and start the service;

[0006] 3.OPC DA client configuration: open the OPC DA client, connect to the OPC DA service, and add measurement points;

[0007] 4.OPC DA client read and write test:

[0008] Read OPC DA service data: write values on the SIS system host computer monitoring software, read values on the OPC DA client, and perform manual comparison;

[0009] Writing data to the OPC DA service: The values are written on the OPC DA client, read by the Safety Instrumented System (SIS) host monitoring software, and manually compared.

[0010] OPC DA testing includes multiple test dimensions, such as Figure 2 As shown, it includes measuring point type, measuring point value range, measuring point area and measuring point scale.

[0011] Based on the above test process, through the accumulation and comparison of test experience of multiple versions, it was found that manual testing has the following problems:

[0012] (1) Due to the large number of data areas and measurement point types, it is difficult to find the measurement points during the test process. When the amount of data is large or the tester is changed, it is even more difficult to find the measurement points.

[0013] (2) Low efficiency: 1000 measurement points, upper and lower limits and initial value testing require at least 6000 writing and 6000 comparisons. The manual operation test steps are cumbersome and time-consuming, which cannot meet the needs of efficient testing.

[0014] (3) Human errors: During manual testing, errors may occur in the test results due to factors such as the knowledge and working status of the testers, such as incorrect selection of boundary values and incomplete coverage of test addresses.

[0015] Since traditional OPC DA testing methods often rely on manual operations, are inefficient and prone to errors, there is an urgent need to develop an automated testing system and method to solve one or more of the above-mentioned problems. Summary of the Invention

[0016] An object of the present invention is to provide a new technical solution for an automated testing system and method.

[0017] According to a first aspect of the present invention, there is provided an automated testing system, the system comprising:

[0018] A project download module, used to download the configured project to the controller and run the controller;

[0019] A service configuration module, configured to automatically configure the server program and start the service of the server program when the controller is running;

[0020] A client configuration module, configured to automatically configure the client program when the server program is started;

[0021] The client data reading module is used to automatically read data from the server program after the host computer monitoring software writes data, and determine whether the read data meets the reading expectations to obtain the reading test results;

[0022] In addition, the client writes data module, which is used to automatically write data to the server program. After the server program receives the written data, the written data is read by the host computer monitoring software, and it is determined whether the written data meets the writing expectations to obtain the write test results.

[0023] Optionally, the system further includes a log module for recording the read test result and the write test result.

[0024] Optionally, the specific workflow of the project download module is as follows:

[0025] Start the host computer configuration software;

[0026] Check whether the configured project in the host computer configuration software is opened;

[0027] If the configured project is already open, check whether the Compile All button is highlighted;

[0028] If the full compile button is grayed out, switch the full compile button to highlighted;

[0029] Fully compile the configured project;

[0030] Log into the controller;

[0031] Downloading the fully compiled configured project to the controller;

[0032] After the fully compiled configured project is downloaded, the controller is run.

[0033] Optionally, the specific workflow of the service configuration module is:

[0034] Starting the server program;

[0035] Initializing the configuration data of the server program;

[0036] When the initial configuration data is completed, create a new station, configure the IP, and import the point table generated during the full compilation of the configured project;

[0037] Start the service of the server program.

[0038] Optionally, the specific workflow of the client configuration module is:

[0039] Starting the client program;

[0040] Generating measuring point information according to the information of the configured project in the host computer configuration software;

[0041] Connecting to the service of the server program;

[0042] Waiting for a value to be read or written.

[0043] Optionally, the specific workflow of the client data reading module is as follows:

[0044] Reading initial diagnostic variable values of the controller and the IO module, determining whether the read initial diagnostic variable values meet first reading expectations, and recording the first reading test results;

[0045] Reading a preset initial value of a measuring point, determining whether the read preset initial value of the measuring point meets a second reading expectation, and recording a second reading test result;

[0046] Reading the upper limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read upper limit value of the measuring point meets the third reading expectation, and recording the third reading test result;

[0047] Reading the lower limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read lower limit value of the measuring point meets the fourth reading expectation, and recording the fourth reading test result;

[0048] A read test report is generated based on the first read test result, the second read test result, the third read test result, and the fourth read test result.

[0049] Optionally, the test area in the system includes local variables, global variables and IO variables, and the measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure and function block variables.

[0050] Optionally, the specific workflow of the client data writing module is as follows:

[0051] Writing a measuring point upper limit value, and transmitting the measuring point upper limit value to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the measuring point upper limit value, and recording a first write test result;

[0052] Writing a lower limit value of a measuring point, and transmitting the lower limit value of the measuring point to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the lower limit value of the measuring point, and recording a second write test result;

[0053] A write test report is generated based on the first write test result and the second write test result.

[0054] According to a second aspect of the present invention, there is provided an automated testing method, the method comprising:

[0055] Step S1: downloading the configured project to the controller and running the controller;

[0056] Step S2: When the controller is running, automatically configuring the server program and starting the service of the server program;

[0057] Step S3: When the server program is started, the client program is automatically configured;

[0058] Step S4: After the host computer monitoring software writes the data, the server automatically reads the data from the server program and determines whether the read data meets the reading expectation to obtain a reading test result;

[0059] Step S5: automatically write data to the server program. After the server program receives the written data, the host computer monitoring software reads the written data and determines whether the written data meets the writing expectation to obtain a write test result.

[0060] Optionally, the method further includes step S6: recording the read test result and the write test result.

[0061] Optionally, step S1 specifically includes:

[0062] Start the host computer configuration software;

[0063] Check whether the configured project in the host computer configuration software is opened;

[0064] If the configured project is already open, check whether the Compile All button is highlighted;

[0065] If the full compile button is grayed out, switch the full compile button to highlighted;

[0066] Performing full compilation on the configured project;

[0067] Log into the controller;

[0068] Downloading the fully compiled configured project to the controller;

[0069] After the fully compiled configured project is downloaded, the controller is run.

[0070] Optionally, step S2 specifically includes:

[0071] Starting the server program;

[0072] Initializing the configuration data of the server program;

[0073] When the initial configuration data is completed, create a new station, configure the IP, and import the point table generated during the full compilation of the configured project;

[0074] Start the service of the server program.

[0075] Optionally, step S3 specifically includes:

[0076] Starting the client program;

[0077] Generating measuring point information according to the information of the configured project in the host computer configuration software;

[0078] Connecting to the service of the server program;

[0079] Waiting for a value to be read or written.

[0080] Optionally, step S4 specifically includes:

[0081] Reading initial diagnostic variable values of the controller and the IO module, determining whether the read initial diagnostic variable values meet first reading expectations, and recording the first reading test results;

[0082] Reading a preset initial value of a measuring point, determining whether the read preset initial value of the measuring point meets a second reading expectation, and recording a second reading test result;

[0083] Reading the upper limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read upper limit value of the measuring point meets the third reading expectation, and recording the third reading test result;

[0084] Reading the lower limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read lower limit value of the measuring point meets the fourth reading expectation, and recording the fourth reading test result;

[0085] A read test report is generated based on the first read test result, the second read test result, the third read test result, and the fourth read test result.

[0086] Optionally, in the method, the test area includes local variables, global variables and IO variables, and the measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure and function block variables.

[0087] Optionally, step S5 specifically includes:

[0088] Writing a measuring point upper limit value, and transmitting the measuring point upper limit value to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the measuring point upper limit value, and recording a first write test result;

[0089] Writing a lower limit value of a measuring point, and transmitting the lower limit value of the measuring point to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the lower limit value of the measuring point, and recording a second write test result;

[0090] A write test report is generated based on the first write test result and the second write test result.

[0091] According to a third aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of an automated testing method as described in the second aspect of the present invention are implemented.

[0092] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the automated testing method described in the second aspect of the present invention are implemented.

[0093] According to an embodiment disclosed in the present invention, an automated testing system and method of the present invention have the following beneficial effects:

[0094] The automated test system of the present invention is based on the configured project of the upper computer configuration software. By writing a client program, it completes the automatic reading and writing of protocol data and automatically judges the reading and writing results. The interface operations such as controller project downloading and value writing are completed by the automated test system. The entire test process does not require human participation, and the log module automatically records detailed test results. By optimizing the measurement point search, improving the test efficiency and reducing human errors, it brings significant improvements to the test process, which not only improves the accuracy and reliability of the test, but also greatly improves the efficiency and convenience of operation of the test, thereby meeting the high-quality and high-efficiency testing needs.

[0095] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0097] Figure 1 This is a flow chart of the traditional OPC DA test method;

[0098] Figure 2 It is a box diagram of the test dimensions;

[0099] Figure 3 A schematic diagram of the structure of an automatic testing system provided in this embodiment;

[0100] Figure 4 A schematic diagram of the process flow of the engineering download module provided in this embodiment;

[0101] Figure 5 A schematic diagram of the service configuration module provided in this embodiment;

[0102] Figure 6A schematic diagram of the process flow of the client configuration module provided in this embodiment;

[0103] Figure 7 A schematic diagram of the process of the client reading data module provided in this embodiment;

[0104] Figure 8 A schematic diagram of the process of writing data to the client provided in this embodiment;

[0105] Figure 9 A schematic flow chart of an automatic testing method provided according to an embodiment;

[0106] Figure 10 A schematic diagram of an electronic device provided according to an embodiment. DETAILED DESCRIPTION

[0107] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention.

[0108] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0109] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0110] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0111] Example 1:

[0112] See also Figure 3 As shown, an embodiment of the present invention provides an automated testing system, the system comprising:

[0113] The project download module 10 is used to download the configured project to the controller and run the controller;

[0114] The service configuration module 20 is used to automatically configure the server program and start the service of the server program when the controller is running;

[0115] The client configuration module 30 is used to automatically configure the client program when the server program is started;

[0116] The client data reading module 40 is used to automatically read data from the server program after the host computer monitoring software writes data, and determine whether the read data meets the reading expectation to obtain the reading test result;

[0117] In addition, the client data writing module 50 is used to automatically write data to the server program. After the server program receives the written data, the written data is read by the host computer monitoring software, and it is determined whether the written data meets the writing expectations to obtain the write test results.

[0118] It should be noted that the automated testing system of this embodiment is not only applicable to the OPC DA protocol, but also to the testing of protocols such as OPC UA and Modbus. It can be used not only in SIS systems, but also in other control systems, such as distributed control systems (DCS), supervisory control and data acquisition (SCADA), and programmable logic controller systems (PLC).

[0119] To improve the efficiency and accuracy of testing protocols such as OPC DA, the automated testing system of the present invention includes a project download module, a service configuration module, a client configuration module, a client data reading module, and a client data writing module, which can automatically complete the following tasks:

[0120] 1. The project download module automatically downloads existing configuration projects;

[0121] 2. The service configuration module automatically configures services;

[0122] 3. The client configuration module automatically configures the client;

[0123] 4. The client data reading module automatically writes the test data on the host computer monitoring software, reads the data through the client, and compares it with the expected result to verify the correctness of the result.

[0124] 5. The client data writing module automatically writes test data to the service and automatically reads the online value of the host computer monitoring software, compares it with the expected result, and verifies the correctness of the result.

[0125] The entire test system uses UI automation testing tools to complete the software interface operation and write client programs to read and write data. The entire process does not require human participation.

[0126] The automated testing system of the present invention not only improves testing efficiency but also significantly enhances test accuracy and consistency through standardized testing processes and results analysis. Furthermore, it reduces errors caused by manual operation, provides more reliable test data and results, and thus enhances the stability and reliability of industrial automation systems.

[0127] Optionally, the automatic testing system of this embodiment also includes a log module 60 for recording and reading test results and writing test results. It should be noted that the main function of the log module of this embodiment is to record test results and also complete test report printing. Specifically, the log information recorded during the test process is written into a log file in HTML format. The report contains a test overview, test success rate, detailed execution results of each test case, failure reasons and other statistical information. When the test is successful, the log module generates and saves a success log, recording the name, execution time, execution duration and related information of the test case. A successful test will be marked as "successful". When a test fails, the log module records the failure reason in detail, including exception stack trace, failed assertion information, test case input data and execution environment, etc. A failed test will be marked as "failed".

[0128] Optionally, the specific workflow of the engineering download module 10 in the automatic test system of this embodiment is as follows:

[0129] Start the host computer configuration software;

[0130] Check whether the configured project is opened in the host computer configuration software;

[0131] If the configured project is already open, check whether the Full Compile button is highlighted;

[0132] If the Full Compile button is grayed out, switch the Full Compile button to highlighted;

[0133] Fully compile the configured project;

[0134] Login controller;

[0135] Download the fully compiled configured project to the controller;

[0136] After the fully compiled configured project is downloaded, run the controller.

[0137] For details, see Figure 4As shown, the project download module in the automated test system of this embodiment is used to download the configured project to the controller and run it. First, before opening the configured project, check whether the configured project is already open. If the configured project is already open, proceed directly to the next step. Then check whether the full compile button is grayed out. If it is, switch to full compile. This will download the entire configured project to the controller to ensure that the pre-configured measurement point initial values take effect after downloading, facilitating the reading and testing of the measurement point initial values. Finally, execute the controller login, controller download, and run control operations. The download control process adopts intelligent waiting, and the controller runs after the download is complete.

[0138] Optionally, the specific workflow of the service configuration module 20 in the automatic testing system of this embodiment is as follows:

[0139] Start the server program;

[0140] Initialize the configuration data of the server program;

[0141] When the initial configuration data is completed, create a new station, configure the IP, and import the point table generated during the full compilation of the configured project;

[0142] Start the server program service.

[0143] For details, see Figure 5 As shown, the service configuration module in the automated test system of this embodiment is used to configure the service. The configuration process is: first start the server program, then initialize the configuration data. Initializing the configuration data mainly deletes the existing configuration data to prevent the new configuration data from conflicting with the existing configuration data. After the initialization of the configuration data is completed, a new station is created, the IP is configured, and the point table generated during the compilation process of the upper computer configuration project is imported, and finally the service is started.

[0144] Optionally, the specific workflow of the client configuration module 30 in the automatic testing system of this embodiment is as follows:

[0145] Start the client program;

[0146] Generate measurement point information based on the information of the configured project in the host computer configuration software;

[0147] Services that connect to the server program;

[0148] Waiting for a value to be read or written.

[0149] For details, see Figure 6 As shown, the specific workflow of the client configuration module in the automated test system of this embodiment is: first start the client program, then generate measurement point information according to the upper computer configuration project information, including measurement point name, read value comparison data, and data to be written, and finally connect to the service and wait for the read and write values.

[0150] Optionally, the specific working process of the client data reading module 40 in the automatic test system of this embodiment is as follows:

[0151] Read the initial diagnostic variable values of the controller and the IO module, determine whether the read initial diagnostic variable values meet the first reading expectations, and record the first reading test results;

[0152] Reading the preset initial value of the measuring point, determining whether the read preset initial value of the measuring point meets the second reading expectation, and recording the second reading test result;

[0153] Read the upper limit value of the measuring point written by the system host computer monitoring software, determine whether the read upper limit value of the measuring point meets the third reading expectation, and record the third reading test result;

[0154] Read the lower limit value of the measuring point written by the system host computer monitoring software, determine whether the read lower limit value of the measuring point meets the fourth reading expectation, and record the fourth reading test result;

[0155] A read test report is generated based on the first read test result, the second read test result, the third read test result, and the fourth read test result.

[0156] Optionally, the test area in the automatic test system of this embodiment includes local variables, global variables and IO variables, and the test point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure and function block variables.

[0157] For details, see Figure 7 As shown, the test process of the client data reading module in the automatic test system of this embodiment includes four test steps:

[0158] Step 1: Read the initial diagnostic variable values of the controller and IO modules (AI module, AO module, DI module, DO module) after they go online, including 44 measurement point information such as power status, self-test status, fault status, master / slave status, synchronization status, communication status, and operation status. Verify whether the read status values meet expectations. If they meet expectations, the test passes. If not, record the test results and proceed to the next test.

[0159] Step 2: Test the initial values of different types of variables. The measurement point area includes local variables, global variables, and IO variables. The measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure, and function block variables, a total of 58 measurement points. Verify whether the preset initial values of the measurement points meet the expectations after reading. If they meet the expectations, the test passes. If not, the test results are recorded and the next test is carried out.

[0160] Step 3: Test the upper limits of different variable types. The test areas include local variables, global variables, and IO variables. The measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure, and function block variables, for a total of 1002 measurement points. The upper limit value of the measurement point is given by the host computer monitoring software. After the server transmits it to the client, it verifies whether the value read by the client meets the expected value. If it does, the test passes. If not, the test result is recorded and the next test is carried out.

[0161] Step 4: Test the lower limits of different variable types. The test areas include local variables, global variables, and IO variables. The measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure, and function block variables, for a total of 1002 measurement points. The upper limit value of the measurement point is assigned by the host computer monitoring software. After the server transmits it to the client, the client verifies whether the value read by the client meets the expected value. If it does, the test passes. If not, the test result is recorded and the next test is carried out.

[0162] Optionally, the specific workflow of the client data writing module 50 in the automatic test system of this embodiment is as follows:

[0163] Write the upper limit value of the measuring point, and transmit the upper limit value of the measuring point to the controller via the server program, determine whether the reading flag in the current system host computer monitoring software is consistent with the upper limit value of the measuring point, and record the first write test result;

[0164] Write the lower limit value of the measuring point and transmit it to the controller via the server program, determine whether the reading flag in the current system host computer monitoring software is consistent with the lower limit value of the measuring point, and record the second write test result;

[0165] A write test report is generated based on the first write test result and the second write test result.

[0166] For details, see Figure 8As shown, the test process of the client data writing module in the automatic test system of this embodiment includes two test steps:

[0167] Step 1: Test the upper limits of different variable types. The test areas include local variables, global variables, and I / O variables. Test point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure, and function block variables, for a total of 1002 test points. The client enters the upper limit value for the test point. After the server transmits it to the controller, the automated test program reads the reading flag of the host computer monitoring software. If it meets the requirements, the test passes. If not, the test result is recorded and the next test step is entered.

[0168] Step 2: Test the lower limits of different variable types. The test area includes local variables, global variables, and I / O variables. The measurement point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure, and function block variables, for a total of 1002 measurement points. The client enters the lower limit value for the measurement point. After the server transmits it to the controller, the automated test program reads the reading flag of the host computer monitoring software. If it meets the requirements, the test passes. If it does not meet the requirements, the test result is recorded and the test ends.

[0169] The automated testing system of the present invention provides significant improvements and optimizations to the problems existing in traditional manual testing, which are mainly reflected in the following aspects:

[0170] 1) Improve the efficiency of measuring point search:

[0171] The automated testing system significantly simplifies the measurement point search process through data classification and index optimization. The system automatically searches and filters large amounts of data and measurement points, reducing the difficulty for testers in locating measurement points within complex data. This makes measurement point locating more efficient and accurate even when data volumes are large or when testers are changing.

[0172] 2) Improve test efficiency:

[0173] The automated test system can process test tasks in batches, significantly improving test efficiency. For tests involving thousands of test points, the system automatically performs batch value writing and comparison operations, eliminating the tedious and time-consuming manual steps. By reducing manual operations, the system can complete large-scale tests in a shorter time, meeting the requirements for efficient testing. A comparison shows that manual testing takes at least three days, while automated testing takes only seven minutes.

[0174] 3) Reduce human error:

[0175] The system's automated testing process reduces subjectivity and errors associated with manual operations. Through unified testing procedures and strict boundary value management, the system ensures comprehensive coverage of test targets and accurate selection of test values. The logging module also monitors and records the testing process in real time, enabling timely identification and correction of potential errors, further improving the accuracy and reliability of test results.

[0176] To sum up, the automated testing system of the embodiment of the present invention is based on the configured project of the upper computer configuration software. By writing a client program, it completes the automatic reading and writing of protocol data and automatically judges the reading and writing results. The interface operations such as controller project downloading and writing values are completed by the automated testing system. The entire testing process does not require human participation, and the log module automatically records detailed test results. By optimizing the measurement point search, improving the test efficiency and reducing human errors, it brings significant improvements to the testing process, which not only improves the accuracy and reliability of the test, but also greatly improves the efficiency and convenience of the test, thereby meeting the high-quality and high-efficiency testing requirements.

[0177] Example 2:

[0178] The embodiment of the present invention provides an automated testing method, based on the automated testing system described in Example 1, see Figure 9 As shown, the method includes:

[0179] Step S1: Download the configured project to the controller and run the controller;

[0180] Step S2: When the controller is running, automatically configure the server program and start the service of the server program;

[0181] Step S3: When the server program is started, the client program is automatically configured;

[0182] Step S4: After the host computer monitoring software writes the data, the server automatically reads the data from the server program and determines whether the read data meets the reading expectation to obtain the reading test result;

[0183] Step S5: Automatically write data to the server program. After the server program receives the written data, the host computer monitoring software reads the written data and determines whether the written data meets the writing expectations to obtain the write test result.

[0184] Optionally, the automated testing method of this embodiment further includes step S6: recording the reading test results and the writing test results.

[0185] Optionally, step S1 in the automated testing method of this embodiment specifically includes:

[0186] Start the host computer configuration software;

[0187] Check whether the configured project is opened in the host computer configuration software;

[0188] If the configured project is already open, check whether the Full Compile button is highlighted;

[0189] If the Full Compile button is grayed out, switch the Full Compile button to highlighted;

[0190] Fully compile the configured project;

[0191] Login controller;

[0192] Download the fully compiled configured project to the controller;

[0193] After the fully compiled configured project is downloaded, run the controller.

[0194] Optionally, step S2 in the automated testing method of this embodiment specifically includes:

[0195] Start the server program;

[0196] Initialize the configuration data of the server program;

[0197] When the initial configuration data is completed, create a new station, configure the IP, and import the point table generated during the full compilation of the configured project;

[0198] Start the server program service.

[0199] Optionally, step S3 in the automated testing method of this embodiment specifically includes:

[0200] Start the client program;

[0201] Generate measurement point information based on the information of the configured project in the host computer configuration software;

[0202] Services that connect to the server program;

[0203] Waiting for a value to be read or written.

[0204] Optionally, step S4 in the automated testing method of this embodiment specifically includes:

[0205] Read the initial diagnostic variable values of the controller and the IO module, determine whether the read initial diagnostic variable values meet the first reading expectations, and record the first reading test results;

[0206] Reading the preset initial value of the measuring point, determining whether the read preset initial value of the measuring point meets the second reading expectation, and recording the second reading test result;

[0207] Read the upper limit value of the measuring point written by the system host computer monitoring software, determine whether the read upper limit value of the measuring point meets the third reading expectation, and record the third reading test result;

[0208] Read the lower limit value of the measuring point written by the system host computer monitoring software, determine whether the read lower limit value of the measuring point meets the fourth reading expectation, and record the fourth reading test result;

[0209] A read test report is generated based on the first read test result, the second read test result, the third read test result, and the fourth read test result.

[0210] Optionally, in the automated testing method of this embodiment, the test area includes local variables, global variables and IO variables, and the test point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure and function block variables.

[0211] Optionally, step S5 in the automated testing method of this embodiment specifically includes:

[0212] Write the upper limit value of the measuring point, and transmit the upper limit value of the measuring point to the controller via the server program, determine whether the reading flag in the current system host computer monitoring software is consistent with the upper limit value of the measuring point, and record the first write test result;

[0213] Write the lower limit value of the measuring point and transmit it to the controller via the server program, determine whether the reading flag in the current system host computer monitoring software is consistent with the lower limit value of the measuring point, and record the second write test result;

[0214] A write test report is generated based on the first write test result and the second write test result.

[0215] Example 3:

[0216] The present invention discloses an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of a device access method in any one of the second embodiments disclosed in the present invention are implemented.

[0217] Figure 10 FIG. 1 is a structural diagram of an electronic device according to an embodiment of the present invention. Figure 10As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the electronic device housing, or an external keyboard, touchpad or mouse.

[0218] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0219] Example 4:

[0220] An embodiment of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the automatic testing methods in the second embodiment of the present invention.

[0221] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application. The description is relatively specific and detailed, but it cannot be understood as a limitation on the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of this application, several variations and improvements can be made, which all fall within the scope of protection of this application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

[0222] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

[0223] Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should be understood by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. An automated testing system, characterized in that: The system comprises: A project download module, used to download the configured project to the controller and run the controller; A service configuration module, configured to automatically configure the server program and start the service of the server program when the controller is running; A client configuration module, configured to automatically configure the client program when the server program is started; The client data reading module is used to automatically read data from the server program after the host computer monitoring software writes data, and determine whether the read data meets the reading expectations to obtain the reading test results; And, a client data writing module is used to automatically write data to the server program. After the server program receives the written data, the written data is read by the host computer monitoring software, and it is determined whether the written data meets the writing expectation to obtain a write test result; The system further includes a log module for recording the read test result and the write test result; The specific workflow of the engineering download module is as follows: Start the host computer configuration software; Check whether the configured project in the host computer configuration software is opened; If the configured project is already open, check whether the Compile All button is highlighted; If the full compile button is grayed out, switch the full compile button to highlighted; Fully compile the configured project; Log into the controller; Downloading the fully compiled configured project to the controller; After the fully compiled configured project is downloaded, run the controller; The specific workflow of the service configuration module is as follows: Starting the server program; Initializing the configuration data of the server program; When the initial configuration data is completed, create a new station, configure the IP, and import the point table generated during the full compilation of the configured project; Start the service of the server program; The specific workflow of the client configuration module is as follows: Starting the client program; Generating measuring point information according to the information of the configured project in the host computer configuration software; Connecting to the service of the server program; Waiting for reading and writing values; The specific workflow of the client data reading module is as follows: Reading initial diagnostic variable values of the controller and the IO module, determining whether the read initial diagnostic variable values meet first reading expectations, and recording the first reading test results; Reading a preset initial value of a measuring point, determining whether the read preset initial value of the measuring point meets a second reading expectation, and recording a second reading test result; Reading the upper limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read upper limit value of the measuring point meets the third reading expectation, and recording the third reading test result; Reading the lower limit value of the measuring point written by the monitoring software of the system host computer, determining whether the read lower limit value of the measuring point meets the fourth reading expectation, and recording the fourth reading test result; generating a read test report based on the first read test result, the second read test result, the third read test result, and the fourth read test result; The test area in the system includes local variables, global variables and IO variables, and the test point types include bool, byte, word, dword, sint, dint, real, lreal, date, date_and_time, array, structure and function block variables; The specific workflow of the client data writing module is as follows: Writing a measuring point upper limit value, and transmitting the measuring point upper limit value to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the measuring point upper limit value, and recording a first write test result; Writing a lower limit value of a measuring point, and transmitting the lower limit value of the measuring point to the controller via the server program, determining whether the reading value flag in the current system host computer monitoring software is consistent with the lower limit value of the measuring point, and recording a second write test result; A write test report is generated based on the first write test result and the second write test result.

2. An automated testing method, characterized in that: The method is applied to the system according to claim 1, and the method comprises: Step S1: downloading the configured project to the controller and running the controller; Step S2: When the controller is running, automatically configuring the server program and starting the service of the server program; Step S3: When the server program is started, the client program is automatically configured; Step S4: After the host computer monitoring software writes the data, the server automatically reads the data from the server program and determines whether the read data meets the reading expectation to obtain a reading test result; Step S5: automatically write data to the server program. After the server program receives the written data, the host computer monitoring software reads the written data and determines whether the written data meets the writing expectation to obtain a write test result.

3. The automated testing method according to claim 2, wherein: The method further includes step S6: recording the read test result and the write test result.

Citation Information

Patent Citations

  • Method and system for testing network pressure

    CN107800593A

  • PLC onsite data acquisition and monitoring module and method based on OPC protocol

    CN108469790A