This command is used for probing parts or fixtures. The axis specified in the G38.2 command will move until the probe touches, if the probe does not touch within the specified distance then the program stops and an alarm is displayed on the screen.
X, Y, Z, A, B Value - specifies the axis you wish to move for probing following the distance to move. The distance value will be the current machine units in use.
F Value - The F value defines the federate at which the axis will move at.
N10 G38.2 Z-10 F100
In the above program the Z axis will move to Z 10 and wait for the probe to touch. Once the probe touches, the Z axis will stop and the program will move to the next gcode line. If the probe is not touched till Z -10 location then the program stops and an alarm is displayed on the screen.