A numerical control system automatic test method and system supporting manual intervention

CN120010441BActive Publication Date: 2026-09-29WUHAN HUAZHONG NUMERICAL CONTROL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510113485.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2026-09-29
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

[0003]上述现有的自动化测试方法,主要存在的缺陷在于:测试用例的输入数据项仅限于G代码文件,不支持在G代码执行过程中进行一些数控系统常见的手动干预操作,例如切换加工模式(自动、单段、手动)、切换加工状态(循环启动、进给保持)、修改G指令参数(刀补、坐标系)、手动移动进给轴等,而实际上更多的数控系统软件缺陷是在手动干预操作过程中产生的,侧面反映出当前数控系统自动化测试的完整性较差,测试覆盖率较低

Benefits of technology

[0045]1)测试用例不仅支持G代码文件的输入,还支持将多种按键和数据输入进行排列组合,以实现手动干预的操作,极大地提升了自动化测试的完整性以及测试覆盖率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010441B_ABST
    Figure CN120010441B_ABST
Patent Text Reader

Abstract

The application discloses a numerical control system automatic test method and system supporting manual intervention, and the method comprises the following steps: recording template data generated in the manual test process of a test case; identifying automatic test operations and manual intervention operations in the test case, and generating a test case script in a test case script generation area in a simulated numerical control panel; reading the test case script, and sending an instruction to a numerical control device; performing automatic test according to the instruction, and recording test data generated in the test process; and detecting whether the test case passes the test according to the test data and the template data. The technical scheme of the embodiment of the application introduces manual intervention operations in the test case, and improves the integrity of the automatic test and the test coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of numerical control technology, and in particular to an automated testing method and system for numerical control systems that supports manual intervention. Background Technology

[0002] Currently, automated testing methods for CNC systems primarily use G-code programs as input for test cases. When a test case is executed for the first time, its correctness is first verified by manual testing. If the execution is correct, a standard template data file for that test case is created. The template file records the instruction field data generated during the execution of the test case. If the test case is executed subsequently, it can be checked whether the instruction field data generated during the execution is consistent with the data in the template file. If they are consistent, the test case is considered to have executed correctly; otherwise, it is considered to have executed incorrectly.

[0003] The main drawback of the existing automated testing methods is that the input data items for test cases are limited to G-code files, and they do not support some common manual intervention operations in CNC systems during the execution of G-code, such as switching machining modes (automatic, single-segment, manual), switching machining states (cycle start, feed hold), modifying G-instruction parameters (tool compensation, coordinate system), and manually moving feed axes. In fact, most CNC system software defects are generated during manual intervention operations, which reflects the poor completeness and low test coverage of the current automated testing of CNC systems.

[0004] Therefore, improving the completeness and coverage of automated testing is a pressing technical issue that needs to be addressed. Summary of the Invention

[0005] This invention provides an automated testing method and system for CNC systems that supports manual intervention, thereby overcoming at least the aforementioned technical problems.

[0006] In a first aspect, embodiments of the present invention provide an automated testing method for CNC systems that supports manual intervention, comprising:

[0007] Record template data generated by test cases during manual testing;

[0008] Identify the automatic test operations and manual intervention operations in the test cases, and generate test case scripts in the test case script generation area of ​​the simulated CNC panel;

[0009] Read the test case script and send instructions to the CNC device; perform automatic testing according to the instructions and record the test data generated during the testing process.

[0010] Based on the test data and the template data, check whether the test cases pass the test.

[0011] Furthermore, the simulated CNC panel includes: a CNC system interface display area, an NC panel, an MCP panel, and a test case script generation area;

[0012] Before identifying test cases, the process also includes:

[0013] The interface of the CNC device is projected onto the CNC system interface display area via a remote desktop protocol;

[0014] Map the NC buttons of the CNC device to the NC panel in the analog CNC panel;

[0015] Map the MCP buttons of the CNC device to the MCP panel in the analog CNC panel.

[0016] Furthermore, the automatic testing operation refers to the operation based on G-code programs; the manual intervention operation refers to the operation based on key events and the CNC system.

[0017] Furthermore, the process of generating the test case script is as follows:

[0018] The analog CNC panel generates automatic test operation instructions based on the automatic test operation.

[0019] The analog CNC panel generates manual intervention operation commands based on manual intervention operations;

[0020] The analog numerical control panel determines the execution time of each instruction based on the operation time of each operation;

[0021] In the test case script generation area of ​​the simulated CNC panel, each instruction and its execution time are written in chronological order.

[0022] Further, the step involves reading the test case script and sending instructions to the CNC device; performing automatic testing according to the instructions; and recording the test data generated during the testing process, including:

[0023] The automated testing system reads the test case script and sends each instruction and its execution time to the CNC device via the Talnet protocol;

[0024] The key event receiving program in the CNC device receives manual intervention operation commands and the execution time of the manual intervention operation commands, and parses them into key events;

[0025] The CNC system in the CNC device receives automatic test operation instructions and the execution time of the automatic test operation instructions, as well as the key events, performs automatic testing, and records the test data generated during the testing process.

[0026] Further, the step of detecting whether the test cases pass the test based on the test data and the template data includes:

[0027] The line numbers of the G-code program in the manual test and the generated template data are collected at a predetermined period. The collected G-code line numbers are used to mark each data segment of the template data to form the first instruction field data.

[0028] The line numbers of the G-code program in the automatic test and the generated test data are collected at the same period. The collected G-code line numbers are used to mark each data segment of the test data to form the second instruction domain data.

[0029] If the first instruction field data is consistent with the second instruction field data, the test case is detected as having passed the test; if the first instruction field data is inconsistent with the second instruction field data, the test case is detected as having failed the test.

[0030] Secondly, embodiments of the present invention provide an automated testing system for CNC systems that supports manual intervention, comprising: a PC and a CNC device;

[0031] The automated testing system is used to record template data generated by test cases during manual testing.

[0032] The simulated CNC panel is used to identify automatic test operations and manual intervention operations in test cases, and to generate test case scripts in the test case script generation area of ​​the simulated CNC panel.

[0033] The automated testing system is also used to read the test case script and send instructions to the CNC device; the CNC device is used to perform automatic testing according to the instructions and record the test data generated during the testing process.

[0034] The automated testing system is also used to detect whether the test cases pass the test based on the test data and the template data.

[0035] Furthermore, the simulated CNC panel is used to identify automatic test operations and manual intervention operations in the test cases, and to generate test case scripts in the test case script generation area of ​​the simulated CNC panel, specifically including:

[0036] The analog CNC panel generates automatic test operation instructions based on the automatic test operation.

[0037] The analog CNC panel generates manual intervention operation commands based on manual intervention operations;

[0038] The analog numerical control panel determines the execution time of each instruction based on the operation time of each operation;

[0039] In the test case script generation area of ​​the simulated CNC panel, each instruction and its execution time are recorded in chronological order.

[0040] Furthermore, the automated testing system is also used to read the test case script and send instructions to the CNC device, specifically including:

[0041] After reading the test case script, the automated testing system sends each instruction and its execution time to the CNC device via the Talnet protocol.

[0042] Furthermore, the key event receiving program in the CNC device is used to receive manual intervention operation commands and the execution time of the manual intervention operation commands, and parse them into key events;

[0043] The CNC system in the CNC device is used to receive automatic test operation instructions and the execution time of the automatic test operation instructions, as well as the key events, to perform automatic testing and record the test data generated during the testing process.

[0044] Compared with the prior art, the beneficial effects of the present invention are:

[0045] 1) Test cases not only support the input of G-code files, but also support the arrangement and combination of various key presses and data inputs to achieve manual intervention, which greatly improves the completeness of automated testing and test coverage;

[0046] 2) By simulating the CNC panel to identify automatic testing operations and manual intervention operations, test case scripts are generated, reducing the difficulty for users to write test case scripts;

[0047] 3) By comparing template data with test data, it is determined whether the automatic test results meet expectations, and then whether the test cases are suitable for the current CNC test system, which increases the versatility of test case scripts.

[0048] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating an automated testing method for CNC systems that supports manual intervention, provided by an embodiment of the present invention.

[0051] Figure 2 This is a schematic diagram of a simulated CNC operation panel for an automated testing method for CNC systems that supports manual intervention, provided in an embodiment of the present invention.

[0052] Figure 3 This is a schematic diagram of the structure of an automated testing system for CNC systems that supports manual intervention, provided in an embodiment of the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

[0054] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0055] Example 1

[0056] Figure 1 This is a flowchart illustrating an automated testing method for CNC systems that supports manual intervention, provided by an embodiment of the present invention. This embodiment is applicable to situations where CNC systems undergo automated testing of test cases, and the method can be executed by an automated testing system for CNC systems that supports manual intervention.

[0057] like Figure 1 As shown, the method specifically includes the following steps:

[0058] S101: Records template data generated during manual testing of test cases.

[0059] It should be noted that in this embodiment of the invention, there are two types of testing: manual testing and automatic testing. Manual testing involves human inspection; when a test case is executed by the CNC system in the CNC device, the human judges whether the testing process and results meet expectations. Automatic testing involves simulating the CNC panel, generating test case scripts, and then having an automated testing program control the CNC device to perform the tests.

[0060] The purpose of manual testing is to select test cases that meet expectations and record the data generated by the test cases during the testing process as template data.

[0061] The purpose of automated testing is to determine whether test cases are suitable for the current CNC system. By comparing the test data generated by the test cases in the automated testing process with the template data generated by the test cases in the manual testing process, it can be determined whether the test cases are suitable for the current CNC system.

[0062] Manual testing does not involve simulating the CNC panel; instead, it is performed by humans based on automatic testing operations and manual intervention. Both manual and automatic testing involve running G-code programs. Therefore, by mapping different lines of G-code programs in manual and automatic testing, and comparing the template data and test data generated during the execution of each line of G-code program, it can be determined whether the test cases are suitable for the current CNC system.

[0063] The template data and test data both include: the starting position, ending position, trajectory, speed, acceleration, time, etc. of the operation point.

[0064] S102: Identify automatic test operations and manual intervention operations in the test cases, and generate test case scripts in the test case script generation area of ​​the simulated CNC panel.

[0065] In this embodiment of the invention, the test case is actually a set, including: test environment, operation steps, input data, and expected results, etc. To verify whether the execution result of the test case is consistent with the expected result, test cases need to be provided to the CNC system in the CNC device.

[0066] The operational steps in the test cases include: automated test operations and manual intervention operations.

[0067] In this embodiment of the invention, automatic testing operations do not refer to operations on statements within the G-code, but rather to operations based on the G-code program, including operations such as selecting, loading, running, and stopping the G-code program. Manual intervention operations, on the other hand, refer to operations based on key events and the CNC system, including operations such as pressing the NC button, pressing the MCP button, restarting the CNC system, and updating the CNC system version.

[0068] Automated testing operations actually refer to operations related to G-code programs. After the user selects a G-code program, the automated testing system on the PC will automatically execute the G-code program. The G-code program can be a pre-written program or a program entered manually.

[0069] Manual intervention refers to the human intervention in the execution of G-code programs during automatic operation. Examples include switching machining modes (automatic, single-segment, manual), switching machining states (cycle start, feed hold), modifying G-instruction parameters (tool compensation, coordinate system), and manually moving the feed axis.

[0070] Figure 2 This is a schematic diagram of a simulated CNC operation panel, as provided in an embodiment of the present invention, illustrating an automated testing method for CNC systems that supports manual intervention. Figure 2 As shown, the simulated CNC panel includes: the CNC system interface display area, the NC panel, the MCP panel, and the test case script generation area.

[0071] Before identifying test cases, the process also includes:

[0072] S211: The interface of the CNC device is projected onto the CNC system interface display area via a remote desktop protocol.

[0073] S212: Map the NC buttons of the CNC device to the NC panel in the analog CNC panel.

[0074] S213: Map the MCP buttons of the CNC device to the MCP panel in the analog CNC panel.

[0075] In this embodiment of the invention, after mapping the CNC device to the CNC system interface display area, a correspondence is established between the NC panel buttons and the NC buttons, and a correspondence is established between the MCP panel buttons and the MCP buttons.

[0076] When the simulated CNC panel identifies test cases, for each manual intervention operation in the test case, the simulated CNC panel will further identify whether it is an NC button operation or an MCP button operation of the CNC device, and match the NC button operation with the NC panel button in the simulated CNC panel, and match the MCP button operation with the MCP panel button in the simulated CNC panel.

[0077] Preferably, different NC panel buttons can be associated with different identifiers. Table 1 provides some NC operation content and their identifiers. As shown in Table 1, the correspondence between NC panel buttons and identifiers is established. When the analog CNC panel recognizes an NC button operation, it first finds the corresponding NC panel button according to the correspondence between NC panel buttons; then, it finds the corresponding identifier according to the correspondence between NC panel buttons and identifiers, and then generates a manual intervention operation command.

[0078] Table 1

[0079]

[0080] Preferably, different MCP panel buttons can be associated with different identifiers. Table 2 provides some MCP operation content and their identifiers. As shown in Table 2, the correspondence between MCP panel buttons and identifiers is established. When the analog CNC panel recognizes an MCP button operation, it first finds the corresponding MCP panel button according to the correspondence between MCP panel buttons; then, it finds the corresponding identifier according to the correspondence between MCP panel buttons and identifiers, and thus generates a manual intervention operation command.

[0081] Table 2

[0082]

[0083] In this embodiment of the invention, the manual intervention operation in the test case can be decomposed into the smallest indivisible sub-step. Each time the NC button or MCP button is pressed, a smallest sub-step is generated. Each smallest sub-step can correspond to an NC panel button or an MCP panel button and is represented by an identifier with a fixed format.

[0084] Furthermore, the process of generating test case scripts is as follows:

[0085] S221: The analog CNC panel generates automatic test operation instructions based on the automatic test operation.

[0086] Automatic test operation instructions can be represented in the format of "operation type (operation content, waiting time)". For example, "PROG_SEND(O13773.txt,3000)" means sending a G-code program named O13773.txt to the CNC system and waiting for 3 seconds.

[0087] S222: The analog CNC panel generates manual intervention operation commands based on manual intervention operations.

[0088] Manual intervention commands can be represented in the format of "operation type (operation content, waiting time)". For example, "NC_KEY(RESET,10)" means pressing the reset button and waiting for 10ms; "MCP_KEY(CYCLE_START,3000)" means pressing the cycle start button and waiting for 3s.

[0089] S223: The analog CNC panel determines the execution time of each instruction based on the operation time of each operation.

[0090] The test cases include various operations and their execution times. By reading this information and reconstructing it in a program-like manner, we can obtain each instruction and its execution time, thus enabling the replay of the test cases.

[0091] S224: In the test case script generation area of ​​the simulated CNC panel, write each instruction and its execution time in chronological order.

[0092] In this embodiment of the invention, each line in the test case script, that is, an automatic test operation instruction or a manual intervention operation instruction, represents an atomic operation. Each atomic operation consists of three parts: operation type, operation content, and waiting time.

[0093] Table 3 provides some operation types and their identifiers. As shown in Table 3, operation types can be classified according to the different functions of the operation object, including: key response, G-code file sending and loading, CNC system restart, and CNC system version update. Among them, G-code file sending and loading corresponds to automatic test operation instructions; key response, CNC system restart, and CNC system version update correspond to manual intervention operation instructions.

[0094] Table 3

[0095]

[0096] The operation content can be determined according to the operation type, as shown in Tables 1 and 2. Table 1 contains common operation content for the NC_KEY type, and Table 2 contains common operation content for the MCP_KEY type. The specific operation content is represented by the CNC system panel button, G-code file name, or CNC system standard upgrade package file name.

[0097] Waiting time represents the interval between the completion of an atomic operation and the start of the next atomic operation, measured in milliseconds (ms).

[0098] Test case scripts can be loaded and executed by automated testing systems. During the loading process, the automated testing system parses the test case script line by line from the beginning to the end of the file, converting each atomic operation into lines of executable code statements. The automated testing system executes the converted code statements in sequence, enabling the playback of test cases in the CNC device.

[0099] S103: Read the test case script and send instructions to the CNC device; perform automatic testing according to the instructions and record the test data generated during the testing process. Specifically:

[0100] After reading the test case script, the automated testing system sends each instruction and its execution time to the CNC device via the Talnet protocol.

[0101] The button event receiving program in the CNC device receives manual intervention operation commands and their execution times, and parses them into button events.

[0102] It should be noted that the underlying operating system of the CNC device initiates a key event receiving program. This program calls the key event handling function at the operating system layer based on manual intervention commands. The key event receiving program can utilize...<linux / input.h> The `struct input_event` in the code defines each key input event on the simulated CNC panel. The defined key input events are written to the keyboard device file in the ` / dev / input / ` directory, which triggers the key event handling function of the underlying operating system. At this time, the operating system notifies the CNC system process of the key event, realizing the playback of the test case script.

[0103] The CNC system in the CNC device receives automatic test operation commands and their execution times, as well as key events, performs automatic tests, and records the test data generated during the test process.

[0104] S104: Based on the test data and template data, check whether the test cases pass the tests. Specifically:

[0105] The line numbers of the G-code program in the manual test and the generated template data are collected at predetermined intervals. The collected G-code line numbers are used to mark each data segment of the template data to form the first instruction field data.

[0106] The line numbers of the G-code program in the automatic test and the generated test data are collected at the same period. The collected G-code line numbers are used to mark each data segment of the test data to form the second instruction domain data.

[0107] Since both manual and automated testing involve the execution of G-code programs, by mapping different lines of G-code programs in manual and automated testing, and by comparing the template data and test data generated during the execution of each line of G-code program, it is possible to determine whether the test cases are suitable for the current CNC system.

[0108] If the data in the first instruction field is consistent with the data in the second instruction field, the test case is detected as having passed the test; if the data in the first instruction field is inconsistent with the data in the second instruction field, the test case is detected as having failed the test.

[0109] Preferably, the CNC system used in manual testing and the CNC system used in automatic testing can be the same system or different systems. Further, the CNC system used in manual testing and the CNC system used in automatic testing can be different versions of the same CNC system.

[0110] The technical solution of this invention discloses an automated testing method for CNC systems that supports manual intervention. First, to facilitate unified identification and management, the manual intervention operations in the test cases are scripted. Second, the test case scripts are recorded through remote desktop protocols and simulated user input on the CNC panel. Third, the test case scripts are replayed using the Talnet protocol and the secondary development interface built into the CNC system. Finally, the correctness of the test case execution results is verified by combining instruction domain big data technology.

[0111] Example 2

[0112] Figure 3 This is a schematic diagram of the structure of an automated testing system for CNC systems that supports manual intervention, provided by an embodiment of the present invention. Figure 3 As shown, it includes: a PC terminal and a CNC device;

[0113] The PC includes a built-in automated testing system, and the CNC device includes a built-in key event receiving program and CNC system; the automated testing system includes a built-in analog CNC panel.

[0114] Among them, the automated testing system is used to record template data generated by test cases during manual testing.

[0115] The simulated CNC panel is used to identify automatic test operations and manual intervention operations in test cases, and to generate test case scripts in the test case script generation area of ​​the simulated CNC panel.

[0116] The automated testing system is also used to read test case scripts and send instructions to the CNC device.

[0117] The numerical control device is used to perform automatic testing according to the instructions and record the test data generated during the testing process.

[0118] The automated testing system is also used to check whether test cases pass the test based on test data and template data.

[0119] Furthermore, the simulated CNC panel is used to generate automatic test operation instructions based on automatic test operations; to generate manual intervention operation instructions based on manual intervention operations; to determine the execution time of each instruction based on the operation time of each operation; and to record each instruction and its execution time in chronological order in the test case script generation area.

[0120] Furthermore, the automated testing system is used to send each instruction and its execution time to the CNC device via the Talnet protocol after reading the test case script.

[0121] Furthermore, the key event receiving program in the CNC device is used to receive manual intervention operation commands and the execution time of the manual intervention operation commands, and parse them into key events.

[0122] Furthermore, the CNC system in the CNC device is used to receive automatic test operation instructions and the execution time of the automatic test operation instructions, as well as the key events, to perform automatic testing and record the test data generated during the testing process.

[0123] The technical solution of this invention supports not only the input of G-code files for test cases, but also the arrangement and combination of various key presses and data inputs, enabling manual intervention and greatly improving the completeness and test coverage of automated testing. Test case script recording is achieved through remote desktop protocols and simulated user input on the CNC panel, reducing the difficulty for users to write test case scripts. Test case script playback is based on the Talnet protocol, calling operating system layer event handling functions, reducing the impact of CNC system version updates on test case scripts and increasing the versatility of test case scripts.

[0124] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0125] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An automated testing method for CNC systems that supports manual intervention, characterized in that, include: Record the template data generated by test cases during manual testing; where a test case is a set including: test environment, operation steps, input data and expected results; Identify the automatic test operations and manual intervention operations in the test cases, and generate test case scripts in the test case script generation area of ​​the simulated CNC panel; wherein, each line in the test case script is an automatic test operation instruction or a manual intervention operation instruction; Read the test case script and send instructions to the CNC device; perform automatic testing according to the instructions and record the test data generated during the testing process. Based on the test data and the template data, check whether the test cases pass the test; The simulated CNC panel includes: a CNC system interface display area, an NC panel, an MCP panel, and a test case script generation area; Before identifying test cases, the process also includes: The interface of the CNC device is projected onto the CNC system interface display area via a remote desktop protocol; Map the NC buttons of the CNC device to the NC panel in the analog CNC panel; Map the MCP buttons of the CNC device to the MCP panel in the analog CNC panel; In this system, different NC panel buttons are associated with different identifiers. When the analog CNC panel recognizes an NC button operation, it first finds the corresponding NC panel button based on the correspondence between NC panel buttons and NC buttons; then it finds the corresponding identifier based on the correspondence between NC panel buttons and identifiers, and then generates a manual intervention operation command. Different MCP panel buttons are associated with different identifiers. When the analog CNC panel recognizes an MCP button operation, it first finds the corresponding MCP panel button based on the correspondence between MCP panel buttons and MCP buttons; then it finds the corresponding identifier based on the correspondence between MCP panel buttons and identifiers, and then generates a manual intervention operation command.

2. The method according to claim 1, characterized in that, The automatic testing operation refers to the operation based on G-code programs; the manual intervention operation refers to the operation based on key events and the CNC system.

3. The method according to claim 1, characterized in that, The process of generating the test case scripts is as follows: The analog CNC panel generates automatic test operation instructions based on the automatic test operation. The analog CNC panel generates manual intervention operation commands based on manual intervention operations; The analog numerical control panel determines the execution time of each instruction based on the operation time of each operation; In the test case script generation area of ​​the simulated CNC panel, each instruction and its execution time are written in chronological order.

4. The method according to claim 3, characterized in that, The process involves reading the test case script and sending instructions to the CNC device. Perform automatic testing according to the instructions, and record the test data generated during the testing process, including: The automated testing system reads the test case script and sends each instruction and its execution time to the CNC device via the Talnet protocol; The key event receiving program in the CNC device receives manual intervention operation commands and the execution time of the manual intervention operation commands, and parses them into key events; The CNC system in the CNC device receives automatic test operation instructions and the execution time of the automatic test operation instructions, as well as the key events, performs automatic testing, and records the test data generated during the testing process.

5. The method according to claim 1, characterized in that, The step of detecting whether a test case passes the test based on the test data and the template data includes: The line numbers of the G-code program in the manual test and the generated template data are collected at a predetermined period. The collected G-code line numbers are used to mark each data segment of the template data to form the first instruction field data. The line numbers of the G-code program and the generated test data in the automatic test are collected at the same period. The collected G-code line numbers are used to mark each data segment of the test data to form the second instruction domain data. Both manual and automatic tests involve the execution of G-code programs. If the first instruction field data is consistent with the second instruction field data, the test case is detected as having passed the test; if the first instruction field data is inconsistent with the second instruction field data, the test case is detected as having failed the test.

6. A system for implementing the automated testing method for CNC systems supporting manual intervention as described in any one of claims 1 to 5, characterized in that, include: PC terminal and CNC device; The PC includes a built-in automated testing system, and the CNC device includes a built-in key event receiving program and a CNC system. The automated testing system includes a built-in analog numerical control panel; The automated testing system is used to record template data generated by test cases during manual testing. The simulated CNC panel is used to identify automatic test operations and manual intervention operations in test cases, and to generate test case scripts in the test case script generation area of ​​the simulated CNC panel. The automated testing system is also used to read the test case script and send instructions to the CNC device; the CNC device is used to perform automatic testing according to the instructions and record the test data generated during the testing process. The automated testing system is also used to detect whether the test cases pass the test based on the test data and the template data.

7. The system according to claim 6, characterized in that, The simulated CNC panel is used to identify automatic test operations and manual intervention operations in test cases, and to generate test case scripts in the test case script generation area of ​​the simulated CNC panel, specifically including: The analog CNC panel generates automatic test operation instructions based on the automatic test operation. The analog CNC panel generates manual intervention operation commands based on manual intervention operations; The analog numerical control panel determines the execution time of each instruction based on the operation time of each operation; In the test case script generation area of ​​the simulated CNC panel, each instruction and its execution time are recorded in chronological order.

8. The system according to claim 6, characterized in that, The automated testing system is also used to read the test case script and send instructions to the CNC device, specifically including: After reading the test case script, the automated testing system sends each instruction and its execution time to the CNC device via the Talnet protocol.

9. The system according to claim 6, characterized in that, include: The key event receiving program in the CNC device is used to receive manual intervention operation commands and the execution time of the manual intervention operation commands, and parse them into key events; The CNC system in the CNC device is used to receive automatic test operation instructions and the execution time of the automatic test operation instructions, as well as the key events, to perform automatic testing and record the test data generated during the testing process.

Citation Information

Patent Citations

  • Test script generation method and device, storage medium and program product

    CN115982024A

  • Numerical control system automatic test method and system based on instruction field big data

    CN116300797A