Pro codes
Pro CNC Codes — System Variables, Look-Ahead, TCP and Hidden Functions
Advanced CNC codes few people are taught: Fanuc system variables, G10 offsets, G05.1 look-ahead, G43.4 TCP, G68.2, Haas G187, Siemens CYCLE832, Heidenhain…
The codes that separate an operator from a programmer: look-ahead and smoothing modes, 5-axis TCP and tilted planes, offsets written from the program, system variables for macros and the parameters that hide builder programs. Most of them are in the manuals, but few people are ever shown them.
High-speed machining
| Code | What it does | Control |
|---|---|---|
G05.1 Q1 | AI contour control (AICC) / look-ahead | Fanuc |
G08 P1 | Advanced preview control (older controls) | Fanuc |
G05 P10000 | High-precision contour control (HPCC) | Fanuc |
G187 | Accuracy / smoothness control | Haas |
CYCLE832 | High-speed settings (Sinumerik) | Siemens |
CYCL DEF 32 | Tolerance cycle (TNC) | Heidenhain |
G103 | Limit block look-ahead | Haas |
COMPCAD | Compressor for CAM data | Siemens |
5-axis
| Code | What it does | Control |
|---|---|---|
G43.4 / G43.5 | Tool center point control (TCP) | Fanuc |
G68.2 | Tilted working plane (3+2) | Fanuc |
CYCLE800 | Swivel plane | Siemens |
TRAORI | 5-axis transformation (TCP) | Siemens |
M128 / FUNCTION TCPM | Keep the tool tip position | Heidenhain |
PLANE SPATIAL | Tilt the working plane | Heidenhain |
G234 / G254 | TCPC and dynamic work offset | Haas |
Offsets and data
| Code | What it does | Control |
|---|---|---|
G10 L2 / L20 | Set a work offset from the program | Fanuc |
G10 L10–L13 | Set tool offsets from the program | Fanuc |
G54.1 P1–P48 | Additional work offsets | Fanuc |
G51.1 / G50.1 | Programmable mirror image | Fanuc |
TRANS / ATRANS / ROT | Programmable frames | Siemens |
Probing
| Code | What it does | Control |
|---|---|---|
G31 | Skip function (probing move) | Fanuc |
Macro and system variables
| Code | What it does | Control |
|---|---|---|
#5001–#5066 | Position variables | Fanuc |
#5201–#5326 | Work offset variables | Fanuc |
#2001–#2400 / #10001… | Tool offset variables | Fanuc |
#4001–#4130 | Modal information | Fanuc |
#3000 / #3006 | User alarm and stop with message | Fanuc |
#3003 / #3004 | Suppress single block and feed hold | Fanuc |
#3901 / #3902 | Parts counter | Fanuc |
#3011 / #3012 | Date and time | Fanuc |
POPEN / DPRNT / PCLOS | Write data out of a macro | Fanuc |
#1000–#1035 / #1100–#1135 | Interface signals (PMC I/O) | Fanuc |
G66 / G67 | Modal macro call | Fanuc |
FN 14 / FN 16 | Error messages and output in Q-parameter programs | Heidenhain |
Hidden and service
| Code | What it does | Control |
|---|---|---|
Parameter 3202 | Protect O8000 and O9000 programs | Fanuc |
Parameters 6700–6713 | Parts counting set-up | Fanuc |
M198 | Call a subprogram from external memory | Fanuc |
$$ $# $G $C $N $J= | Grbl system commands | Grbl |
Lathe and mill-turn
| Code | What it does | Control |
|---|---|---|
G12.1 / G13.1 | Polar coordinate interpolation | Fanuc |
G07.1 | Cylindrical interpolation | Fanuc |
Run any macro example in the Macro B simulator before it touches a machine. Codes marked as options only work if your machine has them.