2010; Green et al. 1996. List of G-codes commonly found on FANUC and similarly designed controls for milling and turning Sources: Smid 2008; Smid 2010; Green et al. 1996. Note: Modal means a code stays in effect until replaced, or cancelled, by another permitted code. Non-Modal means it executes only once. See, for example, codes G09, G61 & G64 below. List of M-codes commonly found on FANUC and similarly designed controls for milling and turning Sources: Smid 2008; Smid 2010; Green et al. 1996. Some older controls require M codes to be in separate blocks (that is, not on the same line). Example program This is a generic program that demonstrates the use of G-Code to turn a part that is 1" diameter by 1" long. Assume that a bar of material is in the machine and that the bar is slightly oversized in length and diameter and that the bar protrudes by more than 1" from the face of the chuck. (Caution: This is generic, it might not work on any real machine! Pay particular attention to point 5 below.) Several points to note: There is room for some programming style, even in this short program. The grouping of codes in line could have been put on multiple lines. Doing so may have made it easier to follow program execution. Many codes are modal, meaning they remain in effect until cancelled or replaced by a contradictory code. For example, once variable speed cutting (CSS) had been selected (), it stays in effect until the end of the program. In operation, the spindle speed increases as the tool near the center of the work to maintain constant surface speed. Similarly, once rapid feed is selected (), all tool movements are rapid until a feed rate code () is selected. It is common practice to use a load monitor with CNC machinery. The load monitor stops the machine if the spindle or feed loads exceed a preset value that is set during the set-up operation. The jobs of the load monitor are various: Prevent machine damage in the event of tool breakage or a programming mistake. This is especially important because it allows safe "lights-out machining", in which the operators set up the job and start it during the day, then go home for the night, leaving the machines running and cutting parts during the night. Because no human is around