Numerical control machining program processing method, medium and numerical control equipment

By using a three-pointer circular buffer mechanism, the low efficiency and quality problems of CNC equipment when processing dense and small line segments are solved, the instruction processing speed and system response capability are improved, the system status tracking logic is simplified, and the stability and simplicity of the equipment are maintained.

CN121934486APending Publication Date: 2026-04-28KEJIE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KEJIE TECH CO LTD
Filing Date
2025-12-22
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing CNC equipment has low processing efficiency when processing dense, tiny line segments, and is prone to processing interruptions and surface marks, which affect processing quality. Existing solutions reduce the processing speed of the equipment.

Method used

A three-pointer circular buffer mechanism is adopted, with the input, output and execution pointers controlled by the decoding thread module and the NC thread module respectively, to achieve fast instruction updates and status feedback, simplify the system status tracking logic and avoid resource contention.

Benefits of technology

It improves the speed at which CNC equipment can process small line segment machining programs, enhances instruction processing and system response capabilities, maintains system simplicity and stability, and avoids the introduction of complex synchronization mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121934486A_ABST
    Figure CN121934486A_ABST
Patent Text Reader

Abstract

The invention relates to a numerical control machining program processing method, a medium and numerical control equipment. The method comprises the following steps: reading a processing program through a decoding thread module, sequentially converting the processing program into decoding data and a motion instruction, pressing the motion instruction into an annular data buffer area, and updating the position of an input pointer through the decoding thread module; a motion instruction is extracted from the annular buffer area through an NC thread module and pressed into a motion control card, and the position of an output pointer is updated through the NC thread module; the motion control card drives equipment to complete machining motion according to the motion instruction and feeds back the machining state to the NC thread module, so that the position of an execution pointer is updated through the NC thread module; wherein the NC thread module determines a motion instruction being executed by the motion control card according to execution mark information returned by the motion control card, and directly updates the position of an execution pointer. The method can effectively improve the speed of processing the small line segment processing program by the equipment system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, medium, and CNC equipment for processing CNC machining programs, belonging to the field of CNC technology. Background Technology

[0002] In existing CNC machining technology, line segments are generally used to describe the machining path. For curved surfaces with large curvature, a large number of tiny line segments are needed to approximate the original shape of the workpiece. However, the dense array of small line segments places higher demands on the processing speed of the CNC equipment system. If the processing speed of the CNC equipment system cannot keep up, it can easily cause fluctuations in the machining process or the machining speed, which seriously affects the machining efficiency and surface finish.

[0003] Specifically, existing CNC equipment systems, when machining densely packed micro-segments (in high-precision milling, the customer's machining program is very large, and the step distance of each segment is generally less than 0.01mm), fail to promptly push new motion commands to the bottom motion buffer when machining extremely dense segments because the host computer moves the buffer pointer based on the remaining number of segments obtained from the motion control card. This results in the bottom motion buffer having no motion commands, causing the machining to be interrupted. When machining is restarted after being interrupted, obvious marks are left on the machined surface, exhibiting a "running," "stopping," and "running" phenomenon, which seriously affects the machining quality.

[0004] Currently, in order to address the workpiece quality issues caused by ultra-dense segment machining, existing equipment systems mainly solve the problem by reducing the cycle time (motion command processing time) of the host equipment system or by using look-ahead parameters to limit the machining speed. However, these solutions will significantly reduce the speed at which the equipment system can process small line segment machining programs. Summary of the Invention

[0005] This invention provides a method, medium, and CNC equipment for processing CNC machining programs, aiming to solve at least one of the technical problems existing in the prior art.

[0006] The technical solution of the present invention relates to a method for processing CNC machining programs. The method according to the present invention includes the following steps: S100: After reading the processing program through the decoding thread module and converting it into decoded data and motion instructions in sequence, the motion instructions are pushed into the circular data buffer, and the input pointer position is updated through the decoding thread module. S200: Extract motion commands from the circular buffer and push them into the motion control card through the NC thread module, and update the output pointer position through the NC thread module; S300: The motion control card drives the device to complete the processing motion according to the motion command, and feeds back the processing status to the NC thread module so that the execution pointer position can be updated by the NC thread module. Wherein, the input pointer is used to point to the position of the circular buffer where a push instruction is ready, the output pointer is used to point to the position of the circular buffer where a read instruction is ready, and the execution pointer is used to point to the position of the circular buffer where an instruction is being executed. The NC thread module determines the motion command being executed by the motion control card based on the execution flag information returned by the motion control card, and directly updates the position of the execution pointer.

[0007] Furthermore, in step S300, the input pointer In is updated by the decoding thread module, and the corresponding buffer space ID is stored in the circular buffer. After the motion command and its corresponding buffer space ID are retrieved from the circular buffer by the NC thread module, the motion command and its corresponding buffer space ID are pushed into the motion control card, so that the NC thread module can obtain the execution mark information according to the motion status information returned by the motion control card.

[0008] Furthermore, in step S100, when it is detected that the difference between the input pointer and the execution pointer is less than the size of the circular buffer, the generated motion instruction is stored in the circular buffer through the decoding thread module, and the position of the input pointer is updated at the same time; otherwise, it enters a polling waiting state.

[0009] Furthermore, in step S200, when the input pointer and the output pointer are not equal, the motion command is retrieved from the circular buffer by the NC thread module and pushed into the motion control card, while the output pointer is updated; otherwise, a polling waiting state is entered.

[0010] The present invention also relates to a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described method.

[0011] The technical solution of the present invention also relates to a CNC equipment for processing CNC machining programs, the CNC equipment including a computer device, the computer device including the aforementioned computer-readable storage medium.

[0012] The technical solution of the present invention also relates to a CNC equipment for CNC machining program processing, characterized in that it includes: A motion control card is used to drive the equipment to perform processing movements according to motion commands; A circular buffer is used to store motion commands; The decoding thread module is used to read the processing program and convert it into decoded data and motion instructions in sequence, and then push it into the circular buffer. The NC thread module is used to push the motion commands from the circular buffer into the motion control card and monitor the status information of the motion control card.

[0013] Furthermore, an input pointer, an output pointer, and an execution pointer are also provided; the input pointer is used to point to the position where the circular buffer is ready to push the instruction, the output pointer is used to point to the position where the circular buffer is ready to read the instruction, and the execution pointer is used to point to the position where the circular buffer is currently executing the instruction.

[0014] Furthermore, the input pointer is independently controlled by the decoding thread module; the output pointer and the execution pointer are independently controlled by the NC thread module.

[0015] Furthermore, the NC thread module directly updates the execution pointer based on the execution flag information fed back by the motion control card.

[0016] The beneficial effects of this invention are as follows: The CNC machining program processing method, medium, and CNC equipment of this invention can effectively improve the speed of processing small line segment machining programs in the equipment system. This invention employs a three-pointer circular buffer to achieve rapid updating of the execution pointer, thereby effectively improving the processing and issuance speed of instructions. This invention uses a pointer update method based on direct feedback of execution status, which can effectively reduce computational resource consumption, significantly improve instruction processing speed and system real-time response capability, and achieve precise and direct positioning of the execution pointer. This not only enhances the accuracy and reliability of pointer updates but also simplifies the logical complexity of system status tracking. Therefore, while improving overall processing efficiency, it eliminates the need to introduce complex synchronization mechanisms, maintaining the simplicity and stability of the system. Attached Figure Description

[0017] Figure 1 This is a basic flowchart of the method according to the present invention.

[0018] Figure 2 This is a schematic diagram of a three-finger ring needle buffer according to the method of the present invention.

[0019] Figure 3 It is a schematic diagram based on the existing two-finger ring needle buffer.

[0020] Figures 4 to 7 This is a schematic diagram illustrating the execution of motion commands according to the method of the present invention.

[0021] Figure 8 It is a diagram illustrating the execution sequence based on the existing equipment system.

[0022] Figure 9 This is a schematic diagram of test data according to the method of the present invention. Detailed Implementation

[0023] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention.

[0024] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a," "described," and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.

[0025] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are used only to distinguish elements of the same type from one another. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. Any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided herein are intended only to better illustrate embodiments of the invention and, unless otherwise required, do not impose a limitation on the scope of the invention.

[0026] See Figures 1 to 7 In some embodiments, the CNC machining program processing method according to the present invention is applied to a system of CNC equipment such as machine tools and machining centers, and the method includes at least the following steps: S100: After reading the processing program through the decoding thread module and converting it into decoded data and motion instructions in sequence, the motion instructions are pushed into the circular data buffer, and the input pointer position is updated through the decoding thread module. S200: Extract motion commands from the circular buffer and push them into the motion control card through the NC thread module, and update the output pointer position through the NC thread module; S300: The motion control card drives the equipment to complete the processing motion according to the motion command, and feeds back the processing status to the NC thread module so that the execution pointer position can be updated by the NC thread module. The input pointer points to the position of the circular buffer where instructions are ready to be pushed, the output pointer points to the position of the circular buffer where instructions are ready to be read, and the execution pointer points to the position of the circular buffer where instructions are being executed. The NC thread module determines the motion instructions being executed by the motion control card based on the execution flag information returned by the motion control card and directly updates the position of the execution pointer.

[0027] See Figures 1 to 2 In some embodiments, the CNC equipment system for CNC machining program processing according to the present invention includes a motion control card, a circular buffer, a decoding thread module, and an NC thread module. The motion control card is used to drive the equipment to perform machining motions according to motion instructions; the circular buffer is used to store motion instructions; the decoding thread module is used to read the machining program and convert it into decoded data and motion instructions in sequence, and then push it into the circular buffer; the NC thread module is used to push the motion instructions from the circular buffer into the motion control card and monitor the status information of the motion control card.

[0028] Furthermore, the CNC equipment system is equipped with input pointers, output pointers, and execution pointers. The input pointer indicates the position in the circular buffer where an instruction is ready to be pushed in, the output pointer indicates the position in the circular buffer where an instruction is ready to be read, and the execution pointer indicates the position in the circular buffer where an instruction is being executed. Furthermore, the input pointer is independently controlled by the decoding thread module; the output pointer and execution pointer are independently controlled by the NC thread module. The NC thread module directly updates the execution pointer based on the execution marker information fed back from the motion control card.

[0029] In some embodiments of the present invention, see Figure 2 The present invention employs a three-pointer circular buffer, which is configured with an input pointer In, an output pointer Out, and an execution pointer Exec. The input pointer In is used to point to the position in the circular buffer where instructions are ready to be pushed, the output pointer Out is used to point to the position in the circular buffer where instructions are ready to be read, and the execution pointer Exec is used to point to the position in the circular buffer where instructions are being executed.

[0030] Specifically, the input pointer In is independently controlled by the decoding thread module and is used to indicate the storage position in the circular buffer where the next motion instruction to be pushed is located. That is, the input pointer In points to the position where the decoding thread module pushes a new motion instruction into the circular buffer. The output pointer Out is independently controlled by the NC thread module and is used to indicate the extraction position in the circular buffer where the next motion instruction to be read is located. That is, the output pointer Out points to the position where the NC thread module reads the motion instruction from the circular buffer. The execution pointer Exec is independently controlled by the NC thread module and is used to indicate the position of the instruction currently being executed by the motion control card in the circular buffer. Specifically, the NC thread module determines the motion instruction currently being executed by the motion control card based on the execution mark information fed back by the motion control card and directly updates the position of the execution pointer Exec. By introducing the execution pointer Exec, the present invention realizes the real-time tracking and rapid update of the instruction execution state.

[0031] It can be understood that, referring to Figure 3 The existing conventional circular buffer adopts a two-pointer form. It realizes the input pointer and the output pointer through the producer-consumer model. Specifically, the size of the existing conventional circular buffer is fixed. For example, it is denoted as M (that is, the total number of elements that the buffer can accommodate is M). The input pointer IN as the producer points to the next position where an instruction is to be written, and the output pointer Out as the consumer points to the next position where an instruction is to be read. Among them, when In >= Out, the remaining space is the total size of the buffer minus the used part (that is, the number of elements between In and Out); when In < Out, it means that the circular buffer has wrapped around, and the remaining space is the sum of the space from Out to the end of the buffer and the space from the beginning of the buffer to In. And the present invention adopts a three-pointer circular buffer, which is provided with an input pointer In, an output pointer Out, and an execution pointer Exec.

[0032] In some embodiments of the present invention, the numerical control device of the technical solution of the present invention includes a circular buffer, a decoding thread module, an NC thread module, and a motion control card. Specifically, due to the limitation of system memory data, all decoding data of the present invention are stored in the circular buffer, and the decoding data are transmitted to the NC thread module through the circular buffer. The input pointer In, the output pointer Out, and the execution pointer Exec all cooperate in the same circular buffer. The system is provided with a decoding thread module and an NC thread module. The decoding thread module is responsible for reading the machining program and interpreting and optimizing each segment of G code, and storing the motion instructions sampled from each segment of G code into the circular buffer. The NC thread module is responsible for extracting data from the circular buffer and simultaneously obtaining the real-time state of the motion control card, and updating the execution pointer Exec at the same time.

[0033] Specifically, the method of this invention first reads a machining program composed of G-code statements through a decoding thread module. The G-code consists of programming instructions describing the machining contour, feed rate, and auxiliary functions. Next, the decoding thread module, acting as the producer, interprets and optimizes each segment of the read G-code line by line. This conversion process includes syntax parsing, coordinate transformation, trajectory optimization, and velocity look-ahead processing, transforming the abstract G-code instructions into concrete, discrete decoded data. Then, the decoding thread module further converts this decoded data into low-level motion instructions that the motion control card can directly recognize and execute. These motion instructions include precise position coordinates, velocity parameters, and time parameters. Information such as time intervals is processed; after the conversion is completed, the motion command data is stored in a circular buffer. At this time, the decoding thread module is only responsible for updating the input pointer In and judging the remaining space in the buffer according to the current position of the execution pointer Exec. Meanwhile, the NC thread module, as the consumer, obtains the converted motion commands from the circular buffer. At the same time, the NC thread module monitors the status information of the motion control card in real time, sends the obtained motion commands to the motion control card in sequence, and is responsible for updating the output pointer Out and the execution pointer Exec. After receiving the motion commands, the motion control card converts them into motor drive signals, which ultimately drive the servo motor and actuator to complete the processing motion of the equipment.

[0034] It is understood that in the entire instruction conversion and execution process of this invention, data sequentially passes through four core stages: G-code parsing and instruction conversion in the decoding thread module, asynchronous caching in the circular buffer, instruction scheduling and distribution in the NC thread module, and signal conversion in the motion control card, forming a complete conversion chain from high-level programming instructions to physical motion. Specifically, since the input pointer In is modified only in the decoding thread module, and the output pointer Out and execution pointer Exec are modified only in the NC thread module, the separation of pointer modification permissions in this invention naturally forms a lock-free queue mechanism, effectively avoiding resource contention between multi-threaded modules and ensuring the high efficiency and real-time performance of CNC system instruction processing.

[0035] Understandably, specifically, see Figure 8 Based on the existing instruction execution sequence of the CNC equipment system, the decoding buffer in the existing CNC equipment system architecture must maintain the same size as the motion control card, for example, Figure 1The current architecture uses a 2500-instruction decoder buffer and an 2500-instruction execution buffer. The host computer obtains the current remaining space of the motion control card at a given time, assuming there are N instructions. Then, based on the remaining space (e.g., N instructions), the decoder buffer queries the entire decoder buffer and updates the execution pointer accordingly. This existing architecture requires querying the entire decoder buffer to update the execution pointer, wasting most of the time on this query and resulting in slow motion push operations. Furthermore, the decoder buffer must be consistent with the motion buffer, preventing a single decoded instruction from being split into multiple motion control card instructions. Additionally, the existing lookahead buffer, to ensure the correctness of the decoded execution pointer, cannot add extra instructions (such as spline interpolation) to the motion instructions. This invention, however, uses a three-pointer circular buffer, enabling rapid updates to the execution pointer, thereby improving instruction processing and delivery speed.

[0036] In some embodiments of the present invention, the present invention uses execution marker information such as UserTag or FileNo fed back by the underlying motion control card to maintain the execution pointer Exec. Here, UserTag is the user marker attached to each motion instruction and the present invention uses the space sequence number of each space in the circular buffer as the marker. FileNo is the line number information marked by the decoding thread module for each segment of G code.

[0037] See Figures 4 to 7 The execution flow between the circular buffer, three pointers, and the actual processing instructions is illustrated here with a specific embodiment. In this embodiment, the size of the circular buffer is set to 8, and the buffer space IDs are sequentially numbered from 0 to 7. The system maintains three key pointers: the input pointer In, the output pointer Out, and the execution pointer Exec. The input pointer In, the output pointer Out, and the execution pointer Exec are used to indicate the push position, the fetch position, and the actual execution position of the instruction, respectively. See also... Figure 4 During system initialization, all three pointers are set to 0, indicating that the circular buffer is empty and there are no instructions to be executed. The execution flow includes at least the following steps: A10. After starting the processing flow, the decoding thread continuously compares the input pointer In with the execution pointer Exec to determine if the circular buffer is full. If not, the corresponding instruction is retrieved from the processing program and pushed into the circular buffer. For example, see... Figure 5 In one operation, the decoding thread pushes two instructions consecutively into buffer spaces ID0 and ID1, and then updates the input pointer In to ID2. At this time, the execution pointer Exec is still 0, and the remaining space in the circular buffer is: 8−(In−Exec)=8−(2−0)=6.

[0038] A20. The NC thread continuously compares the input pointer In and the output pointer Out to determine if the circular buffer is not empty. If it is not empty, the instruction is retrieved from the position pointed to by the output pointer Out, and the buffer space ID corresponding to the instruction is assigned to the UserTag field (user tag) of the motion instruction. Subsequently, the NC thread sends the motion instruction to the motion control card. For example, see... Figure 6 When the input pointer In is at ID5 and the output pointer Out is at ID3, there are still two instructions (ID3 and ID4) in the circular buffer waiting to be sent to the motion control card.

[0039] A30. The NC thread periodically queries the motion control card to obtain the status information of the currently executing instruction and its UserTag value. Based on the obtained UserTag (i.e., the corresponding buffer space ID), the system directly updates the execution pointer Exec, making it point to the buffer location identified by that ID. For example, see... Figure 7 If the UserTag returned by the motion control card is 3, it will be updated to point to ID3.

[0040] A40. The system repeats the above steps. See Figure 8 The system continuously compares the input pointer In with the execution pointer Exec to determine if the circular buffer is full, and compares the input pointer In with the output pointer Out to determine if the circular buffer is empty, until all processing instructions have been executed.

[0041] Understandably, existing technical architectures rely on the remaining space information at the motion control layer and infer the position of the execution pointer through complex calculations. This results in a large computational load and slow instruction processing speed. In contrast, this invention adopts a pointer update method based on direct feedback of the execution state, which can effectively reduce the consumption of computing resources, significantly improve the instruction processing speed and the system's real-time response capability, and achieve accurate and direct positioning of the execution pointer. This not only enhances the accuracy and reliability of pointer updates but also simplifies the logical complexity of system state tracking. Therefore, while improving overall processing efficiency, it does not require the introduction of complex synchronization mechanisms, maintaining the simplicity and stability of the system.

[0042] In some specific embodiments of the present invention, when the decoding thread module pushes the motion command into the circular buffer, the method of the present invention first updates the position of the input pointer In through the decoding thread module, and simultaneously stores the corresponding buffer space ID into the circular buffer; then, the NC thread module retrieves the motion command and its corresponding buffer space ID from the circular buffer, and pushes the motion command and the buffer space ID together into the motion control card; then, the NC thread module obtains execution marker information such as UserTag or FileNo according to the motion status information returned by the motion control card, that is, pushes the circular buffer space ID of the motion control card, and uses the execution marker information to directly update the execution pointer Exec.

[0043] Specifically, the execution flow of the method of the present invention includes: when the device starts processing, the input pointer In, output pointer Out, and execution pointer Exec are first reset; then, the decoding thread module continuously interprets and optimizes the G code. When it is detected that the difference between the input pointer In and the execution pointer Exec is less than the size of the circular buffer, the decoding thread module stores the generated motion command into the circular buffer and updates the position of the input pointer In; otherwise, it enters a polling waiting state. At the same time, the NC thread module continuously queries the status of the circular buffer. When the input pointer In and the output pointer Out are not equal, the NC thread module retrieves the motion command from the circular buffer and pushes it into the motion control card, and updates the output pointer Out; otherwise, it enters a polling waiting state. Simultaneously, the NC thread module determines the motion command being executed by the motion control card based on the user execution mark information such as UserTag or FileNo returned by the motion control card, and directly updates the position of the execution pointer Exec based on the obtained UserTag or FileNo execution mark information, thus completing the real-time tracking of the command execution status. It can be understood that the circular buffer in this embodiment of the present invention can be set to a multiple of 2, thereby effectively improving the computational efficiency of the circular buffer.

[0044] Furthermore, the present invention may also include a decoding buffer and a motion buffer. After the decoding thread module converts the machining program into decoded data, it first stores it in the decoding buffer. Then, the decoding thread module converts the decoded data into motion commands and pushes them into the circular data buffer. The motion commands read from the data buffer by the NC thread module are first stored in the motion buffer, and then the motion control card reads the motion commands from the motion buffer and drives the device to execute them.

[0045] The invention was tested in practice. Specifically, the method of the invention was applied to the CNC system of a machine tool, and the processing efficiency of small line segment machining programs was tested on the new architecture CNC system. The processing efficiency was compared with that of a traditional architecture CNC system. See [link to relevant documentation]. Figure 9It can be seen that, with the step size set to 0.01mm, and with only the upper-level software structure optimized and no optimization done to the lower level, the instruction processing speed is significantly improved by adopting the algorithm architecture and lock-free queue strategy of this invention compared to the existing architecture.

[0046] It should be noted that, compared with the traditional dual-pointer circular buffer, this invention adopts a three-pointer circular buffer architecture. By introducing an independent execution pointer Exec, it achieves precise tracking and confirmation of instruction execution status, effectively distinguishing between the three instruction states of "committed", "pending execution" and "execution completed", enhancing the reliability and maintainability of the system. At the same time, the permission separation design of the three pointers naturally forms a lock-free queue mechanism. The input pointer In is exclusively written by the decoding thread module, while the output pointer Out and the execution pointer Exec are exclusively written by the NC thread module, completely avoiding competition among multi-threaded modules and greatly improving instruction processing efficiency. Furthermore, the strategy of directly mapping and updating the execution pointer Exec through UserTag execution tag information significantly reduces the computational complexity of pointer positioning, eliminates the performance bottleneck of traditional remaining space calculation, and significantly improves the system's real-time performance. In addition, this architecture supports real-time monitoring and error recovery of instruction execution status, and can accurately locate unacknowledged instructions when motion control is abnormal, ensuring the safety and continuity of the processing process. Finally, the three-pointer collaborative working mechanism, while maintaining the high efficiency of the circular buffer, realizes efficient asynchronous communication between upper-layer instruction parsing and lower-layer motion control, thereby achieving high-throughput and low-latency processing of machining program data.

[0047] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with a computer device system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0048] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer device systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.

[0049] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RSM, ROM, etc., such that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.

[0050] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.

[0051] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.

Claims

1. A method for processing CNC machining programs, characterized in that, The method includes the following steps: S100: After reading the processing program through the decoding thread module and converting it into decoded data and motion instructions in sequence, the motion instructions are pushed into the circular data buffer, and the input pointer position is updated through the decoding thread module. S200: Extract motion commands from the circular buffer and push them into the motion control card through the NC thread module, and update the output pointer position through the NC thread module; S300: The motion control card drives the device to complete the processing motion according to the motion command, and feeds back the processing status to the NC thread module so that the execution pointer position can be updated by the NC thread module. Wherein, the input pointer is used to point to the position of the circular buffer where a push instruction is ready, the output pointer is used to point to the position of the circular buffer where a read instruction is ready, and the execution pointer is used to point to the position of the circular buffer where an instruction is being executed. The NC thread module determines the motion command being executed by the motion control card based on the execution flag information returned by the motion control card, and directly updates the position of the execution pointer.

2. The method according to claim 1, characterized in that, In step S300 The decoding thread module updates the position of the input pointer In and stores the corresponding buffer space ID into the circular buffer. After the NC thread module retrieves the motion command and its corresponding buffer space ID from the circular buffer, it pushes the motion command and its corresponding buffer space ID into the motion control card, so that the NC thread module can obtain the execution marker information based on the motion status information returned by the motion control card.

3. The method according to claim 2, characterized in that, In step S100, When the difference between the input pointer and the execution pointer is less than the size of the circular buffer, the generated motion instruction is stored in the circular buffer through the decoding thread module, and the position of the input pointer is updated at the same time; otherwise, the system enters a polling waiting state.

4. The method according to claim 1, characterized in that, In step S200 When the input pointer and the output pointer are not equal, the motion command is retrieved from the circular buffer and pushed into the motion control card through the NC thread module, and the output pointer is updated at the same time; otherwise, the system enters a polling waiting state.

5. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 4.

6. A CNC machining program processing device, characterized in that, include: A computer device, the computer device comprising the computer-readable storage medium according to claim 5.

7. A CNC machining program processing device, characterized in that, include: A motion control card is used to drive the equipment to perform processing movements according to motion commands; A circular buffer is used to store motion commands; The decoding thread module is used to read the processing program, convert it into decoded data and motion instructions in sequence, and then push it into the circular buffer. The NC thread module is used to push the motion commands from the circular buffer into the motion control card and monitor the status information of the motion control card.

8. The CNC equipment according to claim 7, characterized in that, It is also equipped with an input pointer, an output pointer, and an execution pointer; the input pointer is used to point to the position where the circular buffer is ready to push the instruction, the output pointer is used to point to the position where the circular buffer is ready to read the instruction, and the execution pointer is used to point to the position where the circular buffer is currently executing the instruction.

9. The CNC equipment according to claim 8, characterized in that, The input pointer is independently controlled by the decoding thread module; the output pointer and the execution pointer are independently controlled by the NC thread module.

10. The CNC equipment according to claim 8, characterized in that, The NC thread module directly updates the execution pointer based on the execution flag information fed back by the motion control card.

Citation Information

Patent Citations

  • method for realizing retroact movement control in numerically controlled machine system

    CN101178593A

  • Network datagram processing method, system and device

    CN101309261A

  • Method for interacting instruction and hardware in numerical control system

    CN102478813A

  • Instruction output device and method in multithreading processor and multithreading processor

    CN103593169A

  • Speed look-ahead implementation method supporting dynamic adjustment

    CN116820024A