Examples – Fanuc G-code to NCX
Conversion examples from Fanuc G-code to NCX: arcs with G2 and G3, drilling cycles G81 to G85, and length and radius compensation with G43 and G41.
The following examples show how typical Fanuc G-code blocks are converted into the NCX format – each with the source block and the corresponding NCX cells.
Not yet specified
The rows marked with * use radius programming as well as the extended cycle parameters CYCLE_DELAY, CYCLE_SURFACE_ALTITUDE and CYCLE_DEPTH_INCREMENT. These are not yet covered by the current specification – the language is still in development.
Circles and arcs
| Type | Fanuc | NCX |
|---|---|---|
| Arc with center point, clockwise | G2 X20 Y20 I10 J10 | [INTERPO=ARC,CW,CENTER][GOTO:X=20][GOTO:Y=20][CENTER:X=10][CENTER:Y=10] |
| Arc with center point, counterclockwise | G3 X20 Y20 I10 J10 | [INTERPO=ARC,CCW,CENTER][GOTO:X=20][GOTO:Y=20][CENTER:X=10][CENTER:Y=10] |
| Arc with radius, clockwise * | G2 X20 Y20 R10 | [INTERPO=ARC,CW][GOTO:X=20][GOTO:Y=20][RADIUS=10] |
| Arc with radius, counterclockwise * | G3 X20 Y20 R10 | [INTERPO=ARC,CCW][GOTO:X=20][GOTO:Y=20][RADIUS=10] |
Canned cycles
| Type | Fanuc | NCX |
|---|---|---|
| Drilling | G81 Z-21.732 F565 | [CYCLE=DRILL][GOTO:Z=-21.732][FEEDRATE=565] |
| Drilling with dwell time * | G82 Z-21.732 P0.5 F565 | [CYCLE=DRILL,DELAY][GOTO:Z=-21.732][CYCLE_DELAY=0.5][FEEDRATE=565] |
| Deep-hole drilling * | G83 Z-21.732 R5. Q1.2 | [CYCLE=DRILL,DEEP_HOLE][GOTO:Z=-21.732][CYCLE_SURFACE_ALTITUDE=5][CYCLE_DEPTH_INCREMENT=1.2] |
| Tapping | G84 Z-20. F750 | [CYCLE=TAP][GOTO:Z=-20][FEEDRATE=750] |
| Reaming | G85 Z-20. F420 | [CYCLE=REAM][GOTO:Z=-20][FEEDRATE=420] |
| Cancel cycle | G80 | [CYCLE=STOP] |
Length and radius compensation
| Type | Fanuc | NCX |
|---|---|---|
| Length compensation | G43 Z5. H1 | [GOTO:Z=5][OFFSET:LEN=1] |
| Radius compensation, left | G41 Y2. D1 | [COMPENSATION=LEFT][GOTO:Y=2][OFFSET:DIAM=1] |
The specification documents what the individual NCX keywords mean.