G38.2 – Straight Probe Cycle

G38.2 probes parts or fixtures. The axis moves towards the given position until the probe input triggers. If the probe doesn't trigger before the axis reaches that position, the program stops and an alarm is shown.

Syntax
G38.2 Z-10 F100
Coordinates
Always machine coordinates
You need
Probe input assigned (Low → High on trigger)

Parameters

WordMeaning
X / Y / Z / A / BThe axis to probe with, and the furthest machine coordinate it may move to, in the current machine units.
FFeed rate for the probing move.

Example – basic probe

N10 G38.2 Z-10 F100

Z moves towards machine coordinate Z−10 while watching the probe input. When the probe touches, Z stops immediately and the program continues with the next line. If the probe hasn't triggered by Z−10, the program stops and an alarm is shown.

Example – plasma torch height

G38.2 is often used with G92 to set the initial torch height on plasma machines.

N10 G38.2 Z-50
N20 G92 Z0
N30 G0 Z1
CodeResult
G38.2 Z-50Probes Z towards the material surface. Z stops when the probe triggers.
G92 Z0Applies a temporary work offset so the current Z position becomes Z0.
G0 Z1Moves Z one unit above the material surface, setting the cutting height.
INFORMATION
Units are inches or millimetres, depending on the machine setup and whether G20 or G21 is active.