Storage medium, program reading method, execution method, and electronic device

By editing multiple auxiliary function codes onto the same line in the storage medium and setting them before the execution order of the main function code line, the parallel execution of multiple auxiliary function codes is achieved, solving the problem of low efficiency in the traditional M-code execution mechanism and improving CNC machining efficiency.

CN116679620BActive Publication Date: 2026-01-02HANS LASER TECH IND GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310757786.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2026-01-02
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

Traditional M-code execution mechanisms are inefficient in CNC machining, especially in high-power machine tool processing, which makes some processes difficult to implement and leads to inefficiency when there are many M-codes.

Method used

Multiple auxiliary function codes are edited onto the same line in the storage medium and placed before the execution order of the main function code line. The execution of multiple auxiliary function codes in the same line is achieved by reading and executing the program's methods.

Benefits of technology

This improves the execution efficiency of auxiliary function code, thereby increasing CNC machining efficiency, saving time, and reducing the individual execution time of multiple lines of auxiliary function code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116679620B_ABST
    Figure CN116679620B_ABST
Patent Text Reader

Abstract

The application provides a storage medium, a program reading method, an execution method and an electronic device. The storage medium stores at least one program, the at least one program includes a main function code and a plurality of auxiliary function codes, the plurality of auxiliary function codes are arranged in a line, and a code line recording the plurality of auxiliary function codes is arranged before the execution order of the main function code line. The storage medium provided by the application stores a program that edits the plurality of auxiliary function codes to the same line and arranges the code line of the plurality of auxiliary function codes before the execution order of the main function code line. In this way, during the execution of numerical control machining, the corresponding program execution mechanism can be matched to execute the plurality of auxiliary function codes in the same line. Compared with the traditional auxiliary function code which is read separately, the time is saved, the execution efficiency of the auxiliary function code is improved, and the numerical control machining efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of numerical control machining, and more particularly to a storage medium, a program reading method, an execution method, and an electronic device. BACKGROUND

[0002] In numerical control machining, a large number of auxiliary function codes (referred to as M codes) are needed to execute various processes. The traditional M code execution mechanism is single-row single M code execution, that is, one M code per row, and only the current row can be executed. In this way, the PLC single cycle only processes a single process, which has met the needs of simple machining processes, but there is a great waste of efficiency for high-power machine tool machining processes with more processes. Moreover, in the field of numerical control machining, M codes are mostly in subprograms, and the traditional M code execution mechanism will make it difficult to implement some processes and reduce the efficiency of numerical control machining.

[0003] Therefore, there is an urgent need for a program that can improve the efficiency of numerical control machining. SUMMARY

[0004] The embodiments of the application provide a storage medium, which stores a program that edits multiple auxiliary function codes to the same row and sets the code row recording the multiple auxiliary function codes before the execution order of the main function code row. In this way, multiple auxiliary function codes can be executed in the same row, improving the execution efficiency of auxiliary function codes and thus improving the efficiency of numerical control machining.

[0005] The technical scheme adopted by the embodiments of the application is to provide a storage medium, which stores at least one program, the at least one program includes a main function code and multiple auxiliary function codes, the multiple auxiliary function codes are set in a row, and the code row recording the multiple auxiliary function codes is set before the execution order of the main function code row.

[0006] The embodiments of the application also provide a program reading method, which is used to read the program stored in the storage medium as described above, and includes the following steps:

[0007] reading the code row recording the multiple auxiliary function codes; and

[0008] reading the main function code in the execution order and obtaining the execution position of the main function code corresponding to the multiple auxiliary function codes.

[0009] Further, the "reading the main function codes in execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes" comprises the sub-steps of reading the main function codes in execution order and determining the execution time corresponding to the execution positions of the plurality of auxiliary function codes; wherein the execution time comprises the execution of the front part of the current main function code line, the execution of the rear part of the current main function code line and the execution of the last main function code line of the profile.

[0010] Further, the reading method further comprises the steps of: calculating the connection speed of the track of executing the plurality of auxiliary function codes and the track of executing the corresponding main function code line according to the execution time; and determining the execution mode of the auxiliary function code according to the connection speed of the track; wherein the execution mode comprises the mode of executing the auxiliary function code and the main function code of the corresponding line in the same line and the mode of executing the auxiliary function code and the main function code of the corresponding line synchronously.

[0011] The embodiment of the present application further provides a program execution method, which is used for executing the program stored in the storage medium and comprises the steps of: reading the code line recording the plurality of auxiliary function codes; reading the main function codes in execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes; and executing the main function codes and the plurality of auxiliary function codes in the execution order of the program according to the execution order of the main function codes and the execution positions of the main function codes corresponding to the plurality of auxiliary function codes.

[0012] Further, the "reading the main function codes in execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes" comprises the sub-steps of reading the main function codes in execution order and determining the execution time corresponding to the execution positions of the plurality of auxiliary function codes; and the "executing the main function codes and the plurality of auxiliary function codes in the execution order of the program according to the execution order of the main function codes and the execution positions of the main function codes corresponding to the plurality of auxiliary function codes" comprises the sub-steps of executing the main function codes and the plurality of auxiliary function codes in the execution order of the program according to the execution order of the main function codes and the execution time of the main function codes corresponding to the plurality of auxiliary function codes; wherein the execution time comprises the execution of the front part of the current main function code line, the execution of the rear part of the current main function code line and the execution of the last main function code line of the profile.

[0013] Further, the execution method further comprises the steps of: calculating a connection speed of a trajectory of executing the plurality of auxiliary function codes and a trajectory of executing the corresponding main function code line according to the execution timing; and determining an execution mode of the auxiliary function code according to the connection speed of the trajectory; and the "executing the main function code and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function code and the execution position of the plurality of auxiliary function codes corresponding to the main function code" further comprises the sub-steps of: executing the main function code and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function code and the execution mode of the plurality of auxiliary function codes corresponding to the main function code; wherein the execution mode comprises a mode of executing the auxiliary function code and the main function code of the corresponding line in the same line and a mode of executing the auxiliary function code and the main function code of the corresponding line synchronously.

[0014] The embodiment of the present application further provides a program execution method, which is used for executing the program stored in the storage medium and comprises the steps of: reading a program starting code; reading a code line recording a plurality of auxiliary function codes; reading the main function codes in sequence according to the execution order and determining the execution timing corresponding to the execution position of the plurality of auxiliary function codes; calculating a connection speed of a trajectory of executing the plurality of auxiliary function codes and a trajectory of executing the corresponding main function code line according to the execution timing; determining an execution mode of the auxiliary function code according to the connection speed of the trajectory; reading a program ending code; executing the program starting code; executing the main function code and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function code and the execution timing and the execution mode of the plurality of auxiliary function codes corresponding to the main function code; and executing the program ending code; wherein the execution timing comprises front part execution of the current main function code line, rear part execution of the current main function code line and outline last main function code line execution; and the execution mode comprises a mode of executing the auxiliary function code and the main function code of the corresponding line in the same line and a mode of executing the auxiliary function code and the main function code of the corresponding line synchronously.

[0015] Further, when the connection speed in the "determining the execution mode of the auxiliary function code according to the connection speed of the trajectory" is zero, the corresponding execution mode is the mode of executing the auxiliary function code and the main function code of the corresponding line in the same line.

[0016] Further, when the connection speed in the "determining the execution mode of the auxiliary function code according to the connection speed of the trajectory" is greater than zero, the corresponding execution mode is the mode of executing the auxiliary function code and the main function code of the corresponding line synchronously.

[0017] This application also provides an electronic device, including: a processor, a communication bus, and a storage medium as described above; the communication bus is used to realize the connection and communication between the processor and the storage medium; the processor is used to execute one or more programs stored in the storage medium to implement the steps of the program reading method or the steps of the program execution method as described above.

[0018] The beneficial effects of the storage medium provided in this application embodiment are as follows: The storage medium in this application embodiment stores a program that edits multiple auxiliary function codes into the same line and sets the line of code that edits multiple auxiliary function codes before the execution order of the main function code line. In this way, during the CNC machining process, in conjunction with the corresponding program execution mechanism, multiple auxiliary function codes can be executed in the same line. Compared with the traditional method of reading auxiliary function codes separately, this saves more time, improves the execution efficiency of auxiliary function codes, and thus improves the efficiency of CNC machining. Attached Figure Description

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

[0020] Figure 1 A schematic block diagram of the structure of the storage medium provided in the embodiments of this application;

[0021] Figure 2 A flowchart of a program reading method provided in an embodiment of this application;

[0022] Figure 3 for Figure 2 The flowchart for the further program reading method is shown below;

[0023] Figure 4 for Figure 3 The flowchart for the further program reading method is shown below;

[0024] Figure 5 A flowchart illustrating a program reading method combined with a program execution method provided in this application embodiment;

[0025] Figure 6 for Figure 5 A flowchart of the further program reading method combined with the program execution method;

[0026] Figure 7 for Figure 6 A flowchart of the further program reading method combined with the program execution method;

[0027] Figure 8 A more detailed and complete program reading method provided for the embodiments of the present application is combined with the flowchart of the program execution method;

[0028] Figure 9 The structural schematic block diagram of the electronic device provided for the embodiments of the present application is shown.

[0029] In the drawings, various reference numerals refer to:

[0030] 10, storage medium; 20, electronic device; 21, processor. DETAILED DESCRIPTION

[0031] In order to make the technical problems, technical solutions and beneficial effects of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0032] It should be noted that when an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0033] In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited.

[0034] Please refer to Figure 1 The storage medium 10 provided for the embodiments of the present application will now be described. The storage medium 10 provided for the embodiments of the present application stores at least one program, the at least one program includes a main function code and a plurality of auxiliary function codes, the plurality of auxiliary function codes are arranged in a line, and the code line recording the plurality of auxiliary function codes is arranged before the execution order of the main function code line.

[0035] The storage medium 10 of the embodiments of the present application stores a program that edits the plurality of auxiliary function codes to the same line and arranges the code line editing the plurality of auxiliary function codes before the execution order of the main function code line. In this way, during the execution process of numerical control machining, cooperating with the corresponding program execution mechanism, the plurality of auxiliary function codes can be executed in the same line. Compared with the traditional auxiliary function code which is read separately, time is saved, the execution efficiency of the auxiliary function code is improved, and thus the numerical control machining efficiency is improved.

[0036] Please refer to Figure 2 The embodiments of the present application also provide a program reading method, the reading method is used to read the program stored in the storage medium 10 as described above, and includes the following steps:

[0037] S1, reading the code line recording the plurality of auxiliary function codes; and

[0038] S2, read the main function codes in sequence according to the execution order and obtain the execution positions of the main function codes corresponding to the plurality of auxiliary function codes.

[0039] The program reading method of the embodiment of the present application is reading in sequence according to the program, first reading and analyzing all the auxiliary function codes, and then continuing to read the main function code lines in sequence, but when reading each main function code line, the information recorded by the read auxiliary function code is used, wherein each auxiliary function code records the corresponding execution position information, if it is judged that the execution position information of the auxiliary function code meets the execution position of the currently read main function code line, then the reading process will obtain the execution position of the auxiliary function code. Therefore, after one complete reading of the program, the execution positions of all the auxiliary function codes are confirmed. Compared with the traditional auxiliary function code which is read separately, the time is saved, and in the subsequent program execution, the code lines recording multiple auxiliary function codes can be executed in the same line, which can greatly improve the numerical control machining efficiency in mechanical machining.

[0040] Please refer to Figure 3 , wherein the step S2 comprises a sub-step of:

[0041] S21, read the main function codes in sequence according to the execution order and determine the execution time corresponding to the execution positions of the plurality of auxiliary function codes.

[0042] The execution time includes the front execution of the current main function code line, the rear execution of the current main function code line, and the profile last main function code line execution, i.e. the profile tail execution. In the embodiment, if it is determined that there is an auxiliary function code whose execution position corresponds to the current main function code line, then according to the information of the execution position recorded by the auxiliary function code, it is determined that the auxiliary function code is located at the position relative to the current main function code line, i.e. it is determined that the execution position of the auxiliary function code is located in the front or rear of the current main function code line, so that the execution order of the auxiliary function code and the corresponding main function code can be confirmed. It should be noted that if the auxiliary function code whose execution position is located in the profile last main function code line is read, then according to the information of the execution position recorded by the auxiliary function code, it can be determined that the auxiliary function code is located at the position relative to the profile last main function code line, so that after reading, the execution can be performed in order according to the reading confirmed program execution order.

[0043] Please refer to Figure 4 , further, the program reading method further comprises the step of:

[0044] S3, calculating the connection speed of the trajectory of executing the plurality of auxiliary function codes and the trajectory of executing the corresponding main function code line according to the execution time; and

[0045] S4, determining the execution mode of the auxiliary function code according to the connection speed of the track;

[0046] The execution mode includes a mode in which the auxiliary function code and the main function code of the corresponding row are executed in the same row and a mode in which the auxiliary function code and the main function code of the corresponding row are executed synchronously. After confirming the execution time of the auxiliary function code, i.e., the specific execution position, the speed of the connection of the execution track is calculated according to the specific execution position information of the auxiliary function code and the corresponding main function code, and then the execution mode of the auxiliary function code relative to the corresponding main function code is determined according to the connection speed information of the track, i.e., whether the auxiliary function code and the main function code of the corresponding row are executed in the same row or synchronously, so as to meet the actual processing needs of different situations and realize smooth connection.

[0047] Please refer to Figure 5 The embodiment of the present application also discloses a program execution method for executing the program stored in the storage medium 10, including the steps of:

[0048] S11, reading code rows recording a plurality of auxiliary function codes;

[0049] S12, reading the main function codes in sequence according to the execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes; and

[0050] S13, executing the main function codes and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function codes and the execution positions of the main function codes corresponding to the plurality of auxiliary function codes.

[0051] Steps S11 and S12 are program reading steps, and step S13 is executing the program according to the program execution order confirmed after the reading of steps S11 and S12. Thus, compared with the execution mechanism of the conventional auxiliary function code, the embodiment of the present application saves the respective and independent execution time of the plurality of auxiliary function codes, greatly improves the execution efficiency, and thus improves the efficiency of numerical control processing.

[0052] Please refer to Figure 6 The step S12 includes the following sub-steps:

[0053] S121, reading the main function codes in sequence according to the execution order and determining the execution time corresponding to the execution positions of the plurality of auxiliary function codes;

[0054] The step S13 includes the following sub-steps:

[0055] S131, according to the execution sequence of the main function code and the execution time of the plurality of auxiliary function codes corresponding to the main function code, executing the main function code and the plurality of auxiliary function codes according to the execution sequence of the program.

[0056] The execution time includes front execution of the current main function code line, rear execution of the current main function code line, and execution of the last main function code line in the profile.

[0057] In the embodiment, the execution position of the plurality of auxiliary function codes corresponding to the execution time is confirmed through the reading step S121, and then in the subsequent execution step S131, according to the execution sequence of the main function code in the program after reading and analysis and the execution time of the plurality of auxiliary function codes corresponding to the main function code, the main function code and the plurality of auxiliary function codes are executed according to the execution sequence of the program. In this way, the order of the auxiliary function code and the corresponding main function code in the same line can be accurately executed. By executing the corresponding auxiliary function code at the end of the profile, some process actions added at the end of the profile can be conveniently completed.

[0058] Please refer to Figure 7 , further, the program execution method further comprises a step executed between step S121 and step S131:

[0059] S122, according to the execution time, calculating the connection speed of the trajectory of executing the plurality of auxiliary function codes and the trajectory of executing the corresponding main function code line; and

[0060] S123, according to the connection speed of the trajectory, determining the execution mode of the auxiliary function code;

[0061] Step S13 further comprises a sub-step executed simultaneously with step S131:

[0062] S132, according to the execution sequence of the main function code and the execution mode of the plurality of auxiliary function codes corresponding to the main function code, executing the main function code and the plurality of auxiliary function codes according to the execution sequence of the program.

[0063] The execution mode includes the execution mode of the auxiliary function code and the corresponding main function code in the same line, and the execution mode of the auxiliary function code and the corresponding main function code in the same line.

[0064] In the embodiment, in the reading process, after confirming the execution timing of the auxiliary function code, i.e., the specific execution position, by the reading step S121, the reading step S122 calculates the speed of the execution track connection in execution according to the specific execution position information of the auxiliary function code and the corresponding main function code, and then the reading step S123 determines the execution mode of the auxiliary function code relative to the corresponding main function code according to the connection speed information of the track, i.e., determines whether the auxiliary function code and the corresponding main function code are executed in the same row in sequence or are executed synchronously. In this way, in the execution process, the execution step S132 is executed according to the execution mode between the auxiliary function code and the corresponding main function code determined in the reading process, so as to meet the actual processing needs of different situations and realize smooth connection.

[0065] Please refer to Figure 8 The embodiment of the present application further discloses a more detailed program execution method, which is used for executing the program stored in the storage medium 10 and includes the following steps:

[0066] S10, reading a program start code;

[0067] S20, reading a code row recording a plurality of auxiliary function codes;

[0068] S30, reading the main function codes in sequence according to the execution order and determining the execution timing corresponding to the execution positions of the plurality of auxiliary function codes;

[0069] S40, calculating the connection speed of the track of executing the plurality of auxiliary function codes and the track of executing the corresponding main function code row according to the execution timing;

[0070] S50, determining the execution mode of the auxiliary function code according to the connection speed of the track;

[0071] S60, reading a program end code;

[0072] S70, executing the program start code;

[0073] S80, executing the main function codes and the plurality of auxiliary function codes according to the execution order of the program, the execution timing and the execution mode of the plurality of auxiliary function codes corresponding to the main function codes; and

[0074] S90, executing the program end code;

[0075] The execution time includes front execution of the current main function code line, rear execution of the current main function code line, and last main function code line execution of the profile; and the execution mode includes a mode in which the auxiliary function code and the main function code of the corresponding line are executed in sequence and a mode in which the auxiliary function code and the main function code of the corresponding line are synchronously executed.

[0076] The following program is taken as an example to illustrate the program execution method of the embodiment of the application:

[0077] N10 G01 X100Y100

[0078] N20 Q999001

[0079] N30 G01 X10Y10

[0080] N40 G01 X5Y5

[0081] N50 G10

[0082] N60 M30

[0083] The system executes the lines one by one according to the N line number, the N10 line in the program can be understood as the starting code line of the program, the N20 line in the program is a subprogram numbered 999001, and various process control actions and instructions are recorded in the subprogram, such as light-on and gas-on actions, the N20 line can be understood as recording a plurality of auxiliary function code lines, the N30, N40 and N50 lines are main function code lines, and G10 in the N50 line is a track interruption mark, which is generally used to mark a speed zero point at the end of the profile; the M30 in the N60 line in the program is a program end mark, and the N60 line can be understood as a terminating code line of the program.

[0084] If the content of Q999001 in the N20 line is as follows:

[0085] N10 G01 X50Y50 M1

[0086] N20 M2

[0087] wherein G01 X50Y50 is a main function code, M1 is an auxiliary function code, and M2 is an end mark of the subprogram numbered 999001, which has no actual effect and can be ignored.

[0088] If the traditional auxiliary function code execution mechanism is used, the actual function timing of the example program is as follows:

[0089] Start-G01X100Y100-M1-G01X50Y50-G01X10Y10-G01X5Y5-End, or Start-G01X100Y100-G01X50Y50-M1-G01X10Y10-G01X5Y5-End

[0090] According to the procedure execution method of the foregoing embodiment of the present application, the actual function timing of the example procedure is:

[0091] Case 1: The execution time of the M1 code corresponds to the execution of the front part of the current main function code line, and the execution mode is the same-line and same-time execution mode with the main function code of the corresponding line:

[0092] The actual function timing is:

[0093] Start—G01X100Y100—M1—G01X50Y50—G01X10Y10—G01X5Y5—End. The trajectory connection speed of M1 to G01X50Y50 is zero, for example, the instruction in M1 is to open the gas, and then the instruction in G01X50Y50 is executed after the execution of the open gas instruction.

[0094] Case 2: The execution time of the M1 code corresponds to the execution of the front part of the current main function code line, and the execution mode is the same-line and same-time execution mode with the main function code of the corresponding line:

[0095] The actual function timing is:

[0096] Start—G01X100Y100—M1&G01X50Y50—G01X10Y10—G01X5Y5—End. It can be understood that M1 to G01X50Y50 are continuously executed at a reasonable trajectory connection speed. For example, the instruction in M1 is to open the gas, and then the instruction in G01X50Y50 is executed, and the open gas instruction is executed. It can be understood that the G01X50Y50 instruction and the open gas instruction exist simultaneously or synchronously, and for the convenience of understanding, it is understood in this embodiment that the execution is synchronous.

[0097] Case 3: The execution time of the M1 code corresponds to the execution of the rear part of the current main function code line, and the execution mode is the same-line and same-time execution mode with the main function code of the corresponding line:

[0098] The actual function timing is:

[0099] Start—G01X100Y100—G01X50Y50—M1—G01X10Y10—G01X5Y5—End. The trajectory connection speed of M1 to G01X50Y50 is zero, for example, the instruction in M1 is to open the gas, and then the instruction in G01X50Y50 is executed after the execution of the open gas instruction.

[0100] Case 4: The execution time of the M1 code corresponds to the execution of the rear part of the current main function code line, and the execution mode is the same-line and same-time execution mode with the main function code of the corresponding line:

[0101] The actual function timing is:

[0102] Start—G01X100Y100—G01X50Y50—M1&G01X10Y10—G01X5Y5—End. Wherein M1 is executed after G01X50Y50 and is executed synchronously with the main function code of the corresponding line, it can be understood that the corresponding behavior N30 line of M1, i.e. M1&G01X10Y10, M1 is continuously executed to G01X10Y10 at a reasonable trajectory connection speed. For example, the instruction in M1 is to open the gas, and when or during the execution of the G01X10Y10 instruction, the open gas instruction is executed. It can be understood that the G01X10Y10 instruction and the open gas instruction exist simultaneously or synchronously, and for the convenience of understanding, it is understood in this embodiment that they are executed synchronously.

[0103] Case 5: The execution time of the M1 code corresponds to the end of the profile, and the execution mode is the same line before and after the execution of the main function code of the corresponding line:

[0104] The actual function timing is:

[0105] Start—G01X100Y100—G01X50Y50—G01X10Y10—M1—G01X5Y5—End, or Start—G01X100Y100—G01X50Y50—G01X10Y10—G01X5Y5—M1—End. Wherein the trajectory connection speed of M1 to G01X5Y5 is zero, for example, the instruction in M1 is to open the gas, and then the open gas instruction can be executed after the execution of the instruction in G01X50Y50, or the open gas instruction is executed after the execution of the instruction in G01X50Y50.

[0106] Case 6: The execution time of the M1 code corresponds to the end of the profile, and the execution mode is the synchronous execution of the main function code of the corresponding line:

[0107] The actual function timing is:

[0108] Start—G01X100Y100—G01X50Y50—G01X10Y10—M1&G01X5Y5—End. Wherein it can be understood that M1 is continuously executed to G01X5Y5 at a reasonable trajectory connection speed, for example, the instruction in M1 is to open the gas, and then the open gas instruction can be executed when or during the execution of the G01X5Y5 instruction. It can be understood that the G01X5Y5 instruction and the open gas instruction exist simultaneously or synchronously, and for the convenience of understanding, it is understood in this embodiment that they are executed synchronously.

[0109] The execution mode of each M1 code can be flexibly set to achieve different functional development requirements, and meanwhile, the application supports writing multiple M1 codes in the same line for simultaneous execution, which greatly reduces the time overhead of multiple M1 code process instructions. The above-mentioned instruction control mechanism of the M1 code can help to carry out more flexible process design without being limited by the execution mechanism of the traditional M1 code. For example, in industrial production, there is a demand for adjusting the speed at the end of the contour. The traditional way is to modify the trajectory graphics program, but the application embodiment can solve this problem by setting the M1 code priority (contour tail execution), thereby saving the need to modify the main function code. At the same time, the synchronous execution mechanism of the auxiliary function code and the main function code can greatly improve the efficiency and reduce unnecessary process speed reduction.

[0110] Please refer to Figure 9 The application embodiment further discloses an electronic device 20, which comprises a processor 21, a communication bus and a storage medium 10 as described above; the communication bus is used to realize the connection communication between the processor 21 and the storage medium 10; the processor 21 is used to execute one or more programs stored in the storage medium 10 to realize the steps of the program reading method and / or the steps of the program execution method as described above.

[0111] The above only describes the preferred embodiments of the application and is not intended to limit the application. Any modification, equivalent replacement and improvement made within the spirit and principle of the application shall be included in the protection scope of the application.

Claims

1. A program reading method characterized by comprising: The reading method is used for reading a program stored in a storage medium, the storage medium stores at least one program, the at least one program comprises main function codes and a plurality of auxiliary function codes, the plurality of auxiliary function codes are arranged in a line, and a code line recording the plurality of auxiliary function codes is arranged before the execution order of the main function code line; The program reading method comprises the steps of: reading the code line recording the plurality of auxiliary function codes; reading the main function codes in sequence according to the execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes, including: reading the main function codes in sequence according to the execution order and determining the execution positions of the plurality of auxiliary function codes corresponding to the execution time; calculating the connection speed of the track of executing the plurality of auxiliary function codes and the track of executing the corresponding main function code line according to the execution time; and determining the execution mode of the auxiliary function code according to the connection speed of the track. When the connection speed is zero, the corresponding execution mode is that the auxiliary function code and the main function code of the corresponding line are executed in the same line in sequence; when the connection speed is greater than zero, the corresponding execution mode is that the auxiliary function code and the main function code of the corresponding line are executed in a synchronous mode.

2. The reading method according to claim 1, characterized in that, The execution time comprises the front execution of the current main function code line, the rear execution of the current main function code line and the execution of the last main function code line of the profile.

3. A program execution method characterized by comprising: The execution method is used for executing a program stored in a storage medium, the storage medium stores at least one program, the at least one program comprises main function codes and a plurality of auxiliary function codes, the plurality of auxiliary function codes are arranged in a line, and a code line recording the plurality of auxiliary function codes is arranged before the execution order of the main function code line; The program execution method comprises the steps of: reading the code line recording the plurality of auxiliary function codes; reading the main function codes in sequence according to the execution order and obtaining the execution positions of the main function codes corresponding to the plurality of auxiliary function codes, including: reading the main function codes in sequence according to the execution order and determining the execution positions of the plurality of auxiliary function codes corresponding to the execution time; and executing the main function codes and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function codes and the execution positions of the main function codes corresponding to the plurality of auxiliary function codes; calculating the connection speed of the track of executing the plurality of auxiliary function codes and the track of executing the corresponding main function code line according to the execution time; and determining the execution mode of the auxiliary function code according to the connection speed of the track. When the connection speed is zero, the corresponding execution mode is that the auxiliary function code and the main function code of the corresponding line are executed in the same line in sequence; when the connection speed is greater than zero, the corresponding execution mode is that the auxiliary function code and the main function code of the corresponding line are executed in a synchronous mode.

4. The execution method of claim 3, wherein, The execution of the main function codes and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function codes and the execution positions of the main function codes corresponding to the plurality of auxiliary function codes comprises the following sub-steps: executing the main function codes and the plurality of auxiliary function codes according to the execution order of the program according to the execution order of the main function codes and the execution time of the main function codes corresponding to the plurality of auxiliary function codes; The execution timing includes front execution of the current main function code line, rear execution of the current main function code line, and execution of the last main function code line in the profile.

5. The execution method of claim 4, wherein, The execution of the main function code and the plurality of auxiliary function codes according to the execution order of the main function code and the execution position of the plurality of auxiliary function codes corresponding to the main function code further includes the following sub-steps: The execution of the main function code and the plurality of auxiliary function codes according to the execution order of the main function code and the execution mode of the plurality of auxiliary function codes corresponding to the main function code; The execution mode includes the execution mode of the auxiliary function code and the main function code in the same line and the execution mode of the auxiliary function code and the main function code in the same line.

6. A program execution method characterized by comprising: The execution method is used to execute a program stored in a storage medium, the storage medium stores at least one program, the at least one program includes a main function code and a plurality of auxiliary function codes, the plurality of auxiliary function codes are arranged in a line, and the code line recording the plurality of auxiliary function codes is arranged before the execution order of the main function code line; The steps include: Reading the program start code; Reading the code line recording the plurality of auxiliary function codes; Reading the main function code in the execution order and determining the execution position of the plurality of auxiliary function codes corresponding to the execution timing; According to the execution timing, the connection speed of the trajectory of the plurality of auxiliary function codes and the trajectory of the corresponding main function code line is calculated; According to the connection speed of the trajectory, the execution mode of the auxiliary function code is determined; Reading the program termination code; Executing the program start code; According to the execution order of the main function code and the execution timing and execution mode of the plurality of auxiliary function codes corresponding to the main function code, the main function code and the plurality of auxiliary function codes are executed in the execution order of the program; And Executing the program termination code; The execution timing includes front execution of the current main function code line, rear execution of the current main function code line, and execution of the last main function code line in the profile; the execution mode includes the execution mode of the auxiliary function code and the main function code in the same line and the execution mode of the auxiliary function code and the main function code in the same line; When the connection speed is zero, the corresponding execution mode is the execution mode of the auxiliary function code and the main function code in the same line; when the connection speed is greater than zero, the corresponding execution mode is the execution mode of the auxiliary function code and the main function code in the same line.

7. An electronic device, comprising: It includes: A processor, a communication bus, and a storage medium as claimed in claim 1; The communication bus is used to realize the connection communication between the processor and the storage medium; The processor is used to execute one or more programs stored in the storage medium to realize the steps of the program reading method of any one of claims 1 to 2 or the steps of the program execution method of any one of claims 3 to 6.

Citation Information

Patent Citations

  • Executing order deciding method for auxiliary function of nc program

    JP1993053627A

  • Simultaneous operation commanding system by nc program

    JP1996234820A