G17, G18, G19 - Plane selection
In CNC programming, there are 3 G-codes for selecting a plane during NC programming, which are used to define two axes: X, Y or Z. The plane selection is modal and is valid for everyone until you enter a different circular plane command.
The 3 Plane selection G-Codes are:
G17 for XY Plane
G18 for XZ Plane
G19 for YZ Plane

XY plane selection with G17 code.
The XY G17 plane selection code is set by default and sets the plane to the circular
interpolation mode G02 and G03.
In the circular interpolation blocks, the words X, Y, Z, I and J. are valid. The word K is
not valid. If the Z word is programmed in a circular interpolation block, then a spiral
forms in the XY plane. The direction of the arc or spiral in the XY plane can be
determined visually: Positive direction X - to the right side, positive direction Y - up.
The XY plane has a right-handed coordinate system. In G17, the endpoint of the arc is
defined in the block by the words X and Y. The center point of the arc is defined in
the block by the words I and J.
G17 is activated by default. Code G17 is canceled by codes G18 and G19.
Example:
G17
G00X0Y0
M3 S6000
G00Z5
G01X14.1421Y-14.1421
G01Z-0.5F700
G02X14.1421Y14.1421R-20
G01X40.0Y-14.1421
G03X40.0Y14.1421R-20
G01X14.1421Y-14.1421
G00Z5
M5
G00X0Y0

XZ plane selection. Code G18
XZ plane selection code G18 sets the plane to circular interpolation mode G02 and G03. In the circular interpolation blocks, the words X, Y, Z, I and J. are valid. The word J is not valid. If the word Y is programmed in a circular interpolation block, a spiral forms in the XZ plane. The direction of the arc or spiral in the XZ plane can be determined visually: The positive X direction is to the right, the positive Z direction is up. The XZ plane has a right-handed coordinate system.
Code G18 is canceled by codes G17 and G19.
Example:
G18
G00X0Z0
M3 S6000
G00z5 G01X14.1421Z-14.1421
G01Y-0.5F700
G02X14.1421Z14.1421R-20
G01X40.0Z-14.1421
G03X40.0Z14.1421R-20
G01x14.1421Z-14.1421
G00Y5
M5
G00X0Y0
YZ plane selection. Code G19
The YZ plane selection code G19 sets the plane to circular interpolation mode G02 and G03. In circular interpolation blocks, the words X, Y, Z, I, and K are valid. Word I is not valid. If the word X is programmed in a circular interpolation block, then a spiral forms in the YZ plane. The direction of the arc or spiral in the YZ plane can be determined visually: The positive direction Y is to the right, the positive direction Z is up. The YZ plane has a right-handed coordinate system. In G19, the end point of the arc is defined in the block by the words Y and Z. The center point of the arc is defined in the block by the words J and K. Code G19 is canceled by codes G17 and G18.
Example:
G19
G00Y0Z0
M3 S6000
G00X5 G01Y14.1421Z-14.1421
G01X-0.5F700
G02Y14.1421Z14.1421R-20
G01Y40.0Z-14.1421
G03Y40.0Z14.1421R-20
G01Y14.1421Z-14.1421
G00X5
M5
G00Y0Z0