# LinuxCNC M65

Instructions · `M65` · verification: source checked

M65 is a LinuxCNC M-code that turns off a digital output immediately. It acts as soon as the motion controller receives it, so it is not synchronized with axis movement. The output to switch is given by the P word.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | M65 |
| Group | Digital Output Control |
| Syntax | M65 P- |
| Dialect | LinuxCNC |

### Parameters

| Name | Description |
|---|---|
| P | Digital output number to turn off; range 0 to a default of 3, extendable with num_dio. |

## Safety

- M64 and M65 take effect immediately as received by the motion controller; they are not synchronized with movement and will break blending.

## Study notes

- M65 is paired with M64 (turn on digital output immediately); M62/M63 are the motion-synchronized equivalents.
- The P word specifies the digital output number and ranges from 0 to a default maximum of 3.
- The number of digital I/O can be increased with the num_dio parameter when loading the motion controller.
- M65 requires the corresponding motion.digital-out-nn HAL pin to be connected to an output in the HAL file, otherwise it does not function.

## Sources

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

---

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