# LinuxCNC M67

Instructions · `M67` · verification: source checked

M67 is a LinuxCNC G-code M-code that sets an analog output value synchronized with machine motion. The output number is given by the E word (0 to 3 by default) and the value by the Q word, with Q set to 0 turning the output off. The change is queued and takes effect at the beginning of the next motion command, so a motion command such as G0 or G1 should follow it.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | M67 |
| Group | Analog Output Control |
| Syntax | M67 E- Q- |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| E | Output number ranging from 0 to 3 (adjustable from motmod argument num_aio). |
| Q | Value to set (set to 0 to turn off). |

## Connected

- Related: [LinuxCNC G1 Linear Move](https://machineschema.com/instruction/gcode-g01.md)

## Safety

- The E-word output number ranges from 0 to 3 by default; the count is adjustable with the motmod num_aio argument.

## Study notes

- The change of the specified output happens at the beginning of the next motion command; if no motion command follows, the queued change does not happen.
- Because the output change is queued, a motion G-code (G0, G1, etc.) should always be programmed right after M67.
- M67 functions the same way as the queued digital output commands M62 and M63.
- The immediate (non-synchronized) counterpart is M68, which sets the analog output as soon as the command is received.
- The number of analog I/O can be increased with the num_aio parameter (and digital I/O with num_dio) when loading the motion controller.
- M67 will not function unless the appropriate motion.analog-out-nn pins are connected in the HAL file to outputs.

## Sources

1. [M-Codes](https://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m67) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/mcode-m67  
JSON: https://machineschema.com/instruction/mcode-m67.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
