{"id":"gcode-g38-4","model_id":"G38.4","name":"LinuxCNC G38.4","summary":"G38.4 is a LinuxCNC G-code straight-probe instruction that moves away from the workpiece at the current feed rate until the probe loses contact. It stops on loss of contact and signals an error if loss of contact is not detected before the programmed destination is reached. At least one axis word defines the destination point.","study_notes":["The move is a straight line from the current location toward the programmed destination point at the current feed rate; in inverse time feed mode, the whole motion from current point to programmed point takes the specified time.","G38.4 stops when the probe input changes from TRUE (contact closed) to FALSE (contact open), or when the programmed point is reached, whichever occurs first.","G38.4 signals an error if the probe does not lose contact before the destination is reached.","After successful probing, parameters #5061 to #5069 are set to the X, Y, Z, A, B, C, U, V, W coordinates of the controlled point when the probe changed state, in the current work coordinate system.","After unsuccessful probing, parameters #5061 to #5069 are set to the coordinates of the programmed point.","Parameter #5070 is set to 1 if the probe succeeded and 0 if the probe failed.","Probe results in #5061 to #5069 are expressed in the current work coordinate system, not machine coordinates; machine coordinates can be derived using #5021 to #5029 and #5420 to #5428.","A (PROBEOPEN filename.txt) comment opens a file to store the 9-number XYZABCUVW coordinate of each successful straight probe; the file must be closed with (PROBECLOSE).","It is an error if no axis word is used, cutter compensation is enabled, the feed rate is zero, the current point equals the programmed point, or the probe is already in the target state."],"safety_notes":["The probe input signal must be connected to motion.probe-input in a .hal file; TRUE means probe contact closed (touching) and FALSE means probe contact open.","The tool in the spindle must be a probe or must contact a probe switch.","If probing fails, G38.4 signals an error by posting a message on screen if the selected GUI supports it and halts program execution.","Cutter compensation must not be enabled for this probe move.","The feed rate must not be zero.","The probe must not already be in the target state (untouched) when G38.4 is executed."],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g38","title":"G-Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":5,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"G38.4","group":"Straight Probe","syntax":"G38.4 axes","parameters":[{"name":"axes","description":"At least one axis word (X, Y, Z, A, B, C, U, V, W) must be used; the axis words define the destination point. Omitted axes retain their current value."}],"dialect":"LinuxCNC","related":[],"standards":[]},"url":"https://machineschema.com/instruction/gcode-g38-4","license":"https://creativecommons.org/licenses/by/4.0/"}