Specification of the NCX elements

All elements of the NCX language at a glance: keywords, addresses, values, examples and G-code equivalents, from PROGRAM to FEEDRATE_TYPE and COMM.

Each element of the NCX language is written as one cell of the form [KEYWORD:ADDRESS=VALUE]: the keyword, an optional address and the value. The following overview documents all elements with their addresses, values and examples; where available, the corresponding conventional G or M command is given as well. The underlying grammar is described in the Definition.

Program

PROGRAM: Program

Defines the header data of an NC program: name, unit of measurement and an optional comment.

KeywordPROGRAM
Address
  • NAME: Program name (text)
  • UNIT: Unit of measurement of the program (MM or INCH)
  • COMM: Comment on the program (text)
Values
  • MM: Millimeters (for UNIT)
  • INCH: Inches (for UNIT)
ExamplePROGRAM:NAME=5544

Motion

INTERPO: Interpolation

Sets the interpolation mode of the following movement: rapid traverse, feed motion, or a clockwise or counterclockwise arc.

KeywordINTERPO
Values
  • RAPID: Rapid traverse
  • WORK: Feed motion (cutting move)
  • ARC,CW: Arc, clockwise
  • ARC,CCW: Arc, counterclockwise
  • ARC,CW,CENTER: Arc, clockwise, with center point
  • ARC,CCW,CENTER: Arc, counterclockwise, with center point
ExampleINTERPO=ARC,CCW
EquivalentG00/G01/G02/G03

CENTER: Arc center

Specifies the distance from the arc start point to the arc center for circular interpolation, one cell per axis.

KeywordCENTER
Address
  • X, Y, Z: Axis of the arc center
Values
  • n: Distance from the arc start point to the arc center on this axis (incremental, like I/J/K)
ExampleCENTER:X=20
EquivalentI/J/K

GOTO: Movement

Moves the specified axis to the target position. The type of movement is set beforehand with INTERPO; one cell is written per axis.

KeywordGOTO
Address
  • X, Y, Z: Axis
Values
  • n: Target position
ExampleGOTO:X=-22.543

WORKPLANE: Working plane

Selects the working plane. The axis after the plus sign is the tool axis perpendicular to the plane.

KeywordWORKPLANE
Values
  • XY+Z: XY plane, tool axis Z
  • XZ+Y: XZ plane, tool axis Y
  • YZ+X: YZ plane, tool axis X
ExampleWORKPLANE=XY+Z
EquivalentG17/G18/G19

Compensation & offset

COMPENSATION: Radius compensation

Switches tool radius compensation on to the left or right of the programmed contour, or off.

KeywordCOMPENSATION
Values
  • LEFT: Compensation to the left of the contour
  • RIGHT: Compensation to the right of the contour
  • OFF: Compensation off
ExampleCOMPENSATION=OFF
EquivalentG41/G42/G40

OFFSET: Tool offset

Calls a compensation value (offset) for tool length or tool diameter by its number.

KeywordOFFSET
Address
  • LEN: Length offset
  • DIAM: Diameter offset
Values
  • n: Offset number
ExampleOFFSET:LEN=10
EquivalentH/D word

Tools

TOOL_CALL: Tool call

Loads the specified tool into the spindle.

KeywordTOOL_CALL
Values
  • n: Tool number
ExampleTOOL_CALL=12
EquivalentM06

TOOL_SELECT: Tool preselection

Preselects the next tool in the magazine without loading it.

KeywordTOOL_SELECT
Values
  • n: Tool number
ExampleTOOL_SELECT=12
EquivalentT word

Canned cycles

CYCLE: Canned cycle

Activates a canned cycle such as drilling, tapping or reaming; STOP cancels the active cycle.

KeywordCYCLE
Values
  • DRILL: Drilling
  • DRILL,DELAY: Drilling with dwell time
  • DRILL,DEEP_HOLE: Deep-hole drilling
  • TAP: Tapping
  • REAM: Reaming
  • STOP: Cancel the cycle
ExampleCYCLE=DRILL,DEEP_HOLE
EquivalentG81–G85/G80

Machine functions

MACHINE_FUNCTION: Machine function

Switches a control-specific machine function via its M-code number.

KeywordMACHINE_FUNCTION
Values
  • n: M-code number
ExampleMACHINE_FUNCTION=56
EquivalentM word

SPINDLE: Spindle

Turns the spindle on (clockwise or counterclockwise) or off. The address selects the spindle number.

KeywordSPINDLE
Address
  • n: Spindle number
Values
  • CW: On, clockwise
  • CCW: On, counterclockwise
  • OFF: Off
ExampleSPINDLE:1=CCW
EquivalentM03/M04/M05

RPM: Spindle speed

Specifies the spindle speed in revolutions per minute.

KeywordRPM
Values
  • n: Spindle speed in rpm
ExampleRPM=1200
EquivalentS word

Work offset & shift

ORIGIN: Datum

Activates a stored work offset (datum) by its number.

KeywordORIGIN
Values
  • n: Datum number
ExampleORIGIN=1
EquivalentG54–G59

MATRIX: Datum shift

Shifts the active datum by the specified amount along an axis.

KeywordMATRIX
Address
  • SHIFT_X: Shift in X
  • SHIFT_Y: Shift in Y
  • SHIFT_Z: Shift in Z
Values
  • n: Amount of the shift
ExampleMATRIX:SHIFT_X=33.5
EquivalentG52/TRANS

Feed

FEEDRATE: Feed rate

Specifies the feed rate for the following cutting movements.

KeywordFEEDRATE
Values
  • n: Feed rate value
ExampleFEEDRATE=200
EquivalentF word

FEEDRATE_TYPE: Feed rate type

Defines how the feed rate value is interpreted: per minute, per revolution or as feed per tooth.

KeywordFEEDRATE_TYPE
Values
  • MIN: Feed per minute
  • RPM: Feed per revolution
  • FZ: Feed per tooth
ExampleFEEDRATE_TYPE=MIN
EquivalentG94/G95

Comment

COMM: Comment

Inserts a comment into the program. Spaces are not permitted. Join words with underscores instead.

KeywordCOMM
Values
  • text: Comment text (no spaces)
ExampleCOMM=PLANFRAESEN