Home » NC Programming Function And Technology

NC Programming Function And Technology

From the beginning, CNC machine tools have selected aircraft parts with complex profiles for processing, solving major problems that are difficult to solve with common machining methods. The most important feature of CNC machining is the use of perforated strips (or belts) to control the machine for automatic machining. Aircraft, rocket, and engine components have different characteristics, so the size of the aircraft and the rocket zero and component components are large and the contours are complex. Due to the engine parts, parts, small size and high precision, the CNC machine tools selected in the aircraft, rocket manufacturing department and engine manufacturing department are different. In the manufacture of aircraft and rockets, the use of large CNC milling machines with continuous control is predominant. In the manufacture of engines, continuously controlled CNC machines and point controlled CNC machines (such as CNC drills, CNC drills and machining centers) are used.

Process centralization

CNC machine tools typically have a tool holder and a tool magazine that allow you to change tools automatically. The tool change process is controlled automatically by the program. Therefore, the process is more intensive. The centralization of the process brings great economic benefits.

  • (1) Reduce the area of ​​machine tools and save plants.
  • (2) Whether or not the number of intermediate links (intermediate inspection of semi-finished products, temporary storage, etc.) is reduced saves time and personnel.


During CNC machining, there is no manual control of the tool, and a high degree of automation is possible. The benefits are clear.\

⑴ Reduce the requirements for worker operation:

Senior workers on ordinary machine tools cannot be trained in a short amount of time. NC workers who do not need a program have a very short training period (for example, a CNC lathe worker needs a week and can write a simple machining program). In addition, parts machined by CNC machine tools are more accurate than regular workers on traditional machine tools and need to save time.

(2) Decrease the labor intensity of workers:

In the process of machining, CNC workers are almost always excluded from the process, which is very labor-saving.

(3) Product quality is stable:

Automatic machining of CNC machine tools eliminates human error such as fatigue, carelessness and estimation of normal machine tool workers and improves product consistency.

(4) High processing efficiency:

Automatic tool change of CNC machine tools makes the machining process compact and improves labor productivity.

High flexibility

  • Traditional general-purpose machines are flexible but inefficient.
  • Traditional machine tools are efficient, but less adaptable to parts, less rigid, less flexible, and less adaptable to frequent product changes brought about by fierce competition in the market economy. .. As long as the program has changed, new parts can be machined and automated on CNC machine tools. Its flexibility and efficiency allow CNC machine tools to adapt to market competition.

Strong ability

Machine tools can accurately process various contours, and conventional machine tools cannot machine some of the contours. CNC machine tools are especially suitable for the following occasions:

  • 1. Parts that are not discarded.
  • 2, new product development.
  • 3, urgent need for processing.

A program segment is a continuous group of words that can be processed as a unit. It is actually a numerical control processing program. The main part of the part program consists of several blocks. Most program segments are used to instruct the machine to complete or perform an action. A program segment consists of size words, non-size words, and program termination instructions. When writing and printing, each program segment generally occupies one line, similar to screen display programs.

Program format

A routine machining program consists of a start character (one paragraph), a program name (one paragraph), the program body, and a program end command (usually one column). At the end of the program is the Program Terminator.

The program start character and program end character are the same character:% for ISO code and ER for EIA code. The program end instruction can be M02 (program end) or M30 (end tape end).

CNC machine tools generally use stored programs to execute. The common points between M02 and M30 are as follows. Used to stop the spindle, coolant and feed and reset the control system after terminating all other instructions in the program segment.

M02 and M30 are exactly equivalent when used on some machine tools (systems), but are used on other machine tools (systems) as follows:

When you exit the program using M02, the cursor stops at the end of the program after the automatic operation is finished. When you finish running a program using M3O, the cursor and screen display automatically return to the beginning of the program after the automatic operation is finished. You can run the program again by pressing the start button. In M02 and M30, one program segment can be used in combination with other program words, but it is best to list them individually or share only one program segment by sequence number.

The program name is before the program itself and after the program start character. It’s generally a separate line.

There are two types of program names: one is the specified English word (Multiple O) followed by several numbers. The maximum number of digits allowed is specified in the specifications. Usually 2 and 4 digits are used. This format is also known as the program name of the program number.

In another form, the program name consists of English words, numbers or English, and a mixture of numbers. You can also add a “-” symbol in the center. This format gives your user naming program more flexibility. For example, the flange with part number 215 is machined on an LC30 CNC lathe and the third process procedure can be named LC30-FIANGE-215-3. This makes it very convenient to use, store and search. The format used by the program name is determined by the CNC system. %%

  • O1001
  • N0 G92 X0 Y0 Z0
  • N5 G91 G00 X50 Y35 S500 MO3
  • N10 G43 Z-25 T01.01
  • N15 G01 G007 Z-12
  • N20 G00 Z12
  • N25 X40
  • N30 G01 Z-17
  • N35 G00 G44 Z42 M05
  • N40 G90 X0 Y0
  • N45 M30
  • %%

Segment format

The rules for arranging words, letters, and data within a program segment are called segment formats. CNC has historically used a fixed sequence format and a delimiter (HT or TAB) segment format. The formats for these two program segments have passed. Both domestic and foreign languages ​​make widespread use of the variable word address format (also known as the word address format). In this format, the program word length is not fixed and the number of program words is variable. Most numerical control systems use the program segment format because the order of the program words can be set arbitrarily. However, in most cases, program words are used in a particular order within a program segment for convenience of writing, input, inspection, and proofreading.

The programming details are categorized in the detailed format of the CNC machine tool programming manual.

The characters used in programming, the order of program words within a program segment, and the length of the words. for example:

  • / NO3 G02 X + 053 Y + 053 I0 J + 053 F031 S04 T04 M03 LF
  • The detailed format of the above example is:
  • N03 is the block number.
  • G02 indicates that the machining trajectory is a clockwise arc,
  • X + 053, Y + 053 indicate the coordinates of the end point of the processed arc.
  • I0, J + 053 indicate the center coordinates of the processed arc,
  • F031 is the processing feed rate.
  • S04 is the spindle speed.
  • T04 is the tool number of the tool used.
  • M03 is an auxiliary function command.
  • LF block end instruction.
  • / Select the instruction to skip.

The role of the jump selection instruction is that the operator can choose to execute or not execute a program segment in the program using the skip selection instruction, provided that the program is unchanged. The method chosen is typically performed by skipping the selection switch on or off the control panel to achieve a program segment that does or does not execute the “/”.

Run the program

Processing program preparation sometimes encounters this situation:

A set of code segments can be displayed multiple times in a program or used in multiple programs. You can extract the programs in this group, name them, and save them separately. This group of code segments is a subroutine. Subroutines are segments of a machining program that can be called by appropriate machine control commands and generally have independent importance in machining. The main program is the machining program in which the instructions of the first-level subroutine are called. The instruction that calls the subroutine is also a code segment. It generally consists of a subroutine call instruction, a subroutine name, and the number of calls. Specific rules and formats vary from system to system. For example, it is the same as “call subroutine 55 once”, and the FANUC system uses “M98 P55”. The US company A-B system uses “P55x”.

Subroutines can be nested. That is, one layer. The relationship between the upper layer and the lower layer is similar to the relationship between the main program and the first-level subroutine. The maximum number of layers that can be configured is determined by the particular CNC system. The form and structure of the subroutine is similar to that of the main program. The first line is the subroutine number (name) and the last line is the “end subroutine” command. Between them is the subroutine body. However, the exit command function of the main program is to terminate the main program, reset the CNC system, standardize the instructions, and force each system to use M02 or M30. The termination of the subroutine command ends the subroutine and returns to the main program or subroutine, and the command system is not unified, for example, M99 for the FANUC system, M17 for the Siemens system, and AB’s system in the United States. Is M02.

User macros (programs) can be used in NC machining programs.

So-called macro programs are subroutines that contain variables. The method of calling a macro program within a program is called a user macro. The system allows you to use custom macro functions. It is called a user macro function. To execute a user macro function, simply write a user macro command.

The biggest features of user macros are:

  • ● Variables can be used in user macros.
  • ● Calculus, steering statement, various functions can be used
  • ● You can assign values ​​to variables using custom macro commands.

Link to this article:NC Programming Function And Technology

Reprint Statement: If there are no special instructions, all articles on this site are original. Please indicate the source for reprinting:Stamping Wiki,Thanks!^^