Here is one of the highly discussed in cnc forums the Stock Removal Canned Cycle or sometime just called Rough Turning Cycle for the Fanuc cnc machine control. The G-code for the turning cycle is G71.
Fanuc G71 Turning Cycle Explanation
The G71 longitudinal cutting cycle is explained here
N5 G00 X60 Z1 N6 G71 U2 R1 N7 G71 P8 Q9 U0.5 W0 N8 GOO X50 N9 G01 Z-45
The first line of code N5 is the starting point of the cutting cycle. The actual longitudinal cutting cycle code starts at N6. The full cnc program block explanation is here
First block of the G71 Turning cycle
N6 G71 U2 R1
G71 the G-code for the longitudinal cutting cycle.
U Specifies the depth of cut during the cutting cycle.
R The return value when the tool has completed a cut.
Second block of the G71 Turning cycle
N7 G71 P8 Q9 U0.5 W0
G71 The G-code for the longitudinal cutting cycle
P The Contour start block number.
Q The contour end block number.
P & Q The cnc program blocks between the P block number and Q block number will be repeated until the end dimension is not met. In the above code the cnc program block number 8 and 9 will be repeated again and again until the required diameter is not met.
U The finishing allowance in x-axis.
W The finishing allowance in z-axis.