Mastering G11: Canceling Programmable Data Input (G10) on CNC Machines
In CNC programming, the G10 command provides a powerful way to set work offsets, tool offsets, and even modify certain machine parameters directly within your part program. However, G10 initiates a special “data input mode,” and it’s crucial to exit this mode correctly after you’ve finished entering your data. This is where the G11 command comes in. G11 is the data input cancel command, and it’s almost always used in conjunction with G10. Forgetting G11 is a common source of programming errors.
This article explains the purpose and usage of G11 on CNC lathes and machining centers (mills), clarifies its relationship to G10, and provides practical examples and troubleshooting tips. We’ll cover Fanuc, Siemens, and Haas controls, with notes on Mazak and Mitsubishi.
1. Understanding G10 and G11: The “Open” and “Close”
Think of G10 and G11 as a pair of commands that must work together:
- G10: The “open” command. It initiates data input mode. When the CNC control encounters a G10 block, it stops executing normal machining movements and instead prepares to accept new values for offsets, parameters, or other data (depending on the L parameter used with G10). The control remains in this data input mode until it encounters a G11 command.
- G11: The “close” command. It cancels data input mode. After the control executes G11, it returns to normal program execution, interpreting subsequent G-codes as movement commands, machining operations, etc.
Why is G11 Absolutely Necessary?
If you use G10 to enter data but forget to use G11 to cancel data input mode, the control will likely:
- Misinterpret Subsequent G-Codes: The control will try to interpret all subsequent G-code commands (like G00, G01, G02, M03, etc.) as data input for the G10 command, not as movement or machine commands. This will lead to completely unpredictable and potentially very dangerous machine behavior. The machine will not move as intended.
- Generate Errors: The control might generate an alarm or error message, indicating that it’s expecting more data input, that the syntax is incorrect, or that a parameter is out of range. The specific error message will depend on the control system.
- Not Execute Commands: The machine might simply do nothing, leaving you wondering why your program isn’t working.
In short, always use G11 to cancel data input mode after using G10. It’s like closing a parenthesis or a quotation mark – it signals the end of the data input sequence. Failing to do so is like leaving a parenthesis unclosed – the program will not be interpreted correctly.
2. G11 Syntax (Simple and Standard)
The syntax for G11 is extremely simple:
G11 ; Cancel data input mode
There are no parameters or additional values associated with G11 in its standard usage. It simply tells the control, “I’m finished entering data; return to normal operation.”
3. Control Variations
While G11 is generally standard for canceling G10 data input, always check your machine’s documentation:
- Fanuc: G11 is the standard command to cancel G10 data input mode.
- Siemens: Siemens controls generally use G11 for canceling data input mode initiated by G10.
- Haas: Haas controls generally use G11 for canceling data input mode initiated by G10.
- Mazak: Mazak machines, particularly those using Mazatrol, handle offsets and parameter setting differently, often through dedicated menus and interfaces rather than G-codes. In EIA/ISO (G-code) programming on a Mazak, G11 might be used to cancel G10, but always verify this in the machine’s manual. It may have a different or no function.
- Mitsubishi: Mitsubishi controls might use G11 to cancel data input, but the specifics can vary between different MELDAS control series. Always check your specific control’s documentation.
4. Programming Examples (Lathes and Mills)
These examples demonstrate the proper use of G10 and G11. They show complete program snippets to illustrate the context.
CNC Lathe Examples (Fanuc-Style):
Setting Tool Geometry Offset (Absolute):
%
O0001 (G10/G11 Example - Lathe)
G28 U0 W0 ; Home
T0100 ; Select tool 1 (no offset)
G90 ; Absolute mode
G10 L2 P1 X-5.0 Z-10.0 R0.03 ; Set tool 1 geometry: X=-5.0, Z=-10.0, R=0.03
G11 ; Cancel data input mode <-- ESSENTIAL!
T0101 ; Select tool 1 and apply offset 1
G96 S200 M03 ; Constant surface speed, spindle on
G00 X1.0 Z0.1 ; Rapid to start position
G01 Z0.0 F0.1 ; Feed to face
G01 X-0.05 F0.05 ; Feed to center
G00 X1.0 Z0.1 ; Rapid retract
G28 U0 W0 ; Home
M30 ; Program end
%
This example first sets the tool geometry and then cancels the data input.
Incrementally Adjusting Tool Wear Offset:
%
O0002 (G10/G11 Example - Lathe - Wear)
G28 U0 W0 ; Home
T0101 ; Select tool 1, offset 1
G96 S200 M03 ; Constant surface speed
; ... (Machining operations) ...
; (Tool wear measured: +0.01mm in X (diameter), +0.005mm in Z)
G91 ; Incremental mode
G10 L1 P1 U0.02 W0.005 ; Add to tool 1 wear offset (U = X wear)
G11 ; Cancel data input mode <-- ESSENTIAL!
G90 ; Return to absolute mode
; ... continue machining ...
G28 U0 W0 ; Home
M30; Program End
%
This shows how to incrementally adjust for tool wear.
Setting Work Offset (G54):
%
O0003 (G10/G11 Example - Lathe - Work Offset)
G28 U0 W0; Home
G90 ; Absolute mode
G10 L10 P1 X-20.0 Z-50.0 ; Set work offset G54
G11 ; Cancel data input mode <-- ESSENTIAL!
G54 ; Select work offset G54
; ... rest of program ...
G28 U0 W0; Home
M30; Program End
%
CNC Milling Examples (Fanuc-Style):
Setting Work Offset (G55):
%
O0004 (G10/G11 Example - Mill - Work Offset)
G28 G91 Z0; Home Z
G90 ; Absolute mode
G10 L10 P2 X-50.0 Y-30.0 Z-10.0 ; Set work offset G55
G11 ; Cancel data input mode <-- ESSENTIAL!
G55 ; Select work offset G55
; ... rest of program ...
G28 G91 Z0; Home
M30;
%
Incrementally Adjusting Work Offset (G56):
%
O0005 (G10/G11 Example - Mill - Incremental Offset)
G28 G91 Z0; home
G56 ; Select work offset G56
; ... (Machining operations) ...
; (Shift origin by +0.05 in Y)
G91 ; Incremental mode
G10 L10 P3 Y0.05 ; Add 0.05 to G56 Y-axis offset (P3 = G56)
G11 ; Cancel data input mode <-- ESSENTIAL!
G90 ; Return to absolute mode
; ... continue machining ...
G28 G91 Z0;
M30;
%
Setting a Parameter (Example ONLY - Use EXTREME CAUTION):
%
O0006 (G10/G11 Example - Parameter Set - CAUTION)
; (Example: Hypothetically setting parameter #8124 to 1 on a Fanuc control)
; (**DO NOT USE THIS EXAMPLE WITHOUT VERIFYING THE CORRECT L AND P VALUES
; AND THE FUNCTION OF PARAMETER #8124 IN YOUR MACHINE'S MANUAL!**)
G91 ; Incremental Mode (often required for parameter setting)
G10 L91 P8124 X1 ; *Hypothetically* set parameter #8124
G11 ; Cancel data input mode <-- ESSENTIAL!
G90 ; Return to absolute mode
; ... rest of program ...
M30;
%
Example Showing Incorrect Usage (Missing G11):
%
O0007 (G10/G11 Example - INCORRECT - Missing G11)
G90 ; Absolute mode
G10 L10 P1 X-20.0 Z-50.0 ; Set work offset G54
; G11 MISSING HERE!
G00 X0 Y0 Z0 ; This will likely cause an error or VERY unexpected behavior!
M30;
%
In this incorrect example, the G00 X0 Y0 Z0 command will not be executed as a rapid move. The control will likely try to interpret X0, Y0, and Z0 as additional data input for the G10 command, leading to unpredictable results (and potentially a crash).
5. Relationship to Other G-Codes (Review)
- G10 (Programmable Data Input): G11 always follows a G10 to end data input.
- G90/G91 (Absolute/Incremental): The coordinate system mode greatly affects how G10 interprets the values you enter.
- G54-G59 (Work Offsets): G10 is used to set work offset values; G54-G59 select which work offset is active.
- G43/G44, H/D Codes (Tool Offsets - Mills): On mills, tool length and cutter compensation are usually handled with these codes, not G10. However, G10 can sometimes be used, especially for wear offsets.
6. Troubleshooting
Unexpected Machine Behavior After G10:
- Missing G11: The most likely cause. You must cancel data input mode.
- Incorrect G90/G91: You used the wrong coordinate system mode with G10.
- Incorrect L/P Values: You used the wrong L (data type) or P (offset/parameter number).
- Typos: Check for errors in the G10 block.
Offsets Not Being Applied:
- G10 Not Executed: The G10 block might be skipped.
- Incorrect Offset Number: You might be setting an offset that’s not being used.
- Offset not called: The offset was set, but not called up in the program.
Machine Alarms:
- If related to parameters, immediately restore the parameter backup if you have made an error.
7. Best Practices
- Always Use G11 After G10: This is the most important rule.
- Use Comments: Clearly document what each G10 command is doing:
G10 L10 P1 X-20.0 Z-50.0 ; Set work offset G54 (X=-20.0, Z=-50.0) G11 ; Cancel data input
- Use G90 (Absolute) for Setting Offsets: Unless you have a specific reason to use incremental mode, use G90 with G10 for setting offsets.
- Test in Simulation: Always simulate your program, paying close attention to G10 commands, before running it.
- Understand Your Control: Read your machine’s programming manual thoroughly.
- Use Descriptive Names: Use tool and work offset numbers that are meaningful.
- Backup: Always backup parameters and offsets before making changes.
8. CAM Software
Most CAM systems do not directly use G10 and G11 in the generated G-code for setting standard offsets. The CAM software calculates the compensated toolpath, and the post-processor outputs code that uses standard offset selection commands (like G54-G59, G43/G44, H/D codes). G10/G11 are more often used for in-program adjustments or simpler programs not generated by CAM.
9. Mazak and Mitsubishi Controls
- Mazak: Mazak machines, especially those with Mazatrol controls, often handle offsets and parameter settings through dedicated menus and conversational programming interfaces, not primarily through G-codes like G10. In EIA/ISO (G-code) programming on a Mazak, G11 might be used to cancel a G10 data input mode, but this is not guaranteed. Always refer to the specific Mazak machine and control documentation.
- Mitsubishi: Mitsubishi (MELDAS) controls may use G11 to cancel a data input mode initiated by G10, but the specific functions and syntax can vary between different MELDAS series (M800, M80, M700, M70, etc.). It is essential to consult the programming manual for your specific Mitsubishi control. They may also use completely different methods for setting offsets and parameters.
In both cases (Mazak and Mitsubishi), relying on the Fanuc-style G10/G11 behavior without verifying it in the machine’s documentation is very risky.
10. Frequently Asked Questions (FAQ)
Q: What happens if I forget G11 after G10?
A: The control will misinterpret subsequent G-codes, leading to errors, unexpected movements, or a crash.
Q: Can I use G11 without G10?
A: Technically, yes, but it usually has no effect. G11 simply cancels data input mode, and if you’re not in data input mode, it does nothing. It’s harmless, but unnecessary.
Q: Is G11 modal or non-modal?
A: G11 is non-modal. It only applies to the block it’s in. However, since it cancels the modal state initiated by G10, its effect is to return the control to its normal, non-data-input mode.
Q: Is it safe to change machine parameters with G10?
A: Generally, NO. Only do this if you have a complete understanding of what the parameter does and what the implications of changing it are. Always check your manuals and always back up the original settings.
Q: How do I set tool offsets on a mill?
A: Although G10 can be used, it is more typical to use G43/G44 with H codes for tool length compensation, and G41/G42 with D codes for cutter compensation.
Q: How do I set tool offsets on a lathe?
A: G10 is a common way to set tool geometry and wear offsets on a lathe, but always check your machine’s manual, as other methods may be available.
11. Conclusion
The G11 command is the essential companion to G10 for programmable data input on CNC machines. While G10 initiates the data input mode for setting offsets, parameters, and other data, G11 cancels this mode, ensuring that the control returns to normal program execution. Always use G11 after a G10 command.
Understanding the relationship between G10 and G11, the importance of G90/G91 modes, and the specific L parameter syntax for your control system (especially Fanuc, Siemens, and Haas) is crucial for safe and effective CNC programming. While G10 and G11 can provide significant flexibility and automation capabilities, remember that CAM software is often the preferred method for managing offsets, especially for complex parts. Always prioritize using officially supported methods, consult your machine’s documentation, and thoroughly test your programs before cutting metal.