G-Code & M-Code Programming Flashcards
7 cards from real CNC practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 G-Code & M-Code Programming flashcards as text
In G-code, what does 'G52' do?
Answer: Sets a local coordinate system offset
G52 establishes a temporary local coordinate system by shifting the active work coordinate origin by the specified amount.
What is the purpose of the 'D' address word in milling programs?
Answer: Selects the cutter radius compensation offset register
The D-word selects which offset register holds the cutter diameter (or radius) value used by G41/G42 radius compensation.
Which M-code commands an optional program stop that only halts if the machine's optional stop switch is active?
Answer: M01
M01 is an optional stop — the program pauses only if the operator has enabled the optional stop switch on the control panel.
What does a 'G04 P500' block command in a CNC program?
Answer: Dwell (pause) for 500 milliseconds
G04 is the dwell command; P500 specifies a pause of 500 milliseconds, allowing the spindle to stabilize or the coolant to clear.
In CNC turning, which G-code pair is used for constant surface speed and then cancels it for a fixed RPM?
Answer: G96 activates CSS; G97 cancels it and sets fixed RPM
G96 enables Constant Surface Speed mode, and G97 cancels it and locks the spindle at a specific RPM defined by the S-word.
What is the meaning of 'modal' when describing a G-code?
Answer: It remains active until replaced by another code in the same group
Modal G-codes stay in effect for all subsequent blocks until a different code from the same modal group is programmed.
Which G-code is used to define a work coordinate system offset on most Fanuc-style controls?
Answer: G54
G54 selects the first work coordinate system (WCS) offset, which is pre-set by the operator to define the part's datum on the machine.