Now let's take a simple example for macro program entry to illustrate the similarities and differences between macro program and NC program.
A certain enterprise mainly carries out medium-batch processing of 10 parts similar to those shown in Figure 1-1.
Figure 1-1
The parts are made of precision casting. These parts have 6 processing elements, including inner hole, inner chamfer, end face, outer round corner, small outer circle and taper between small outer circle and large outer circle. These 10 parts are processed in turn irregularly.
Figure 1-1 shows a schematic diagram of one of the parts. When processing this part, the first step uses the end face external cylindrical tool to turn the end face and the outer contour, and the second step uses the internal cylindrical turning tool to turn the inner hole and chamfer the inner corner. Only the first step is discussed here.
The NC program for the first step is as follows:
Picture
Each part needs to be programmed with a similar NC program, but in fact, only the data in segments N12~N17 in these 10 programs are different.
Therefore, the 8 dimension data shown in Figure 1-1 are replaced by 8 variables (#1~#7, #18) respectively, and they are assigned values before executing the program segment (macro segment) containing these variables
(Among them, #1 represents the chamfer size of the inner hole diameter, which will be used in the next step).
At this time, executing this macro segment that replaces the constant with the variable value is the same as executing the NC segment.
The following is a macro program for turning the part shown in Figure 1-1:
Picture
Executing this macro program is the same as executing the 0001NC program.
The processing of several other parts can also borrow this macro program, as long as the first seven variables are reassigned according to the actual size of the part to be processed (that is, change the value). This macro program has other formats, which will be introduced in detail later.





