M66 pauses program execution until a selected digital or analog input reaches a specified state, or until a programmed timeout expires. The input is chosen with a P- word (digital) or an E- word (analog), the wait condition with an L- word, and the timeout in seconds with a Q- word. The input value read is stored in parameter #5399, which holds -1 if the timeout is exceeded.
| Language | gcode |
|---|---|
| Code | M66 |
| Group | M-Codes |
| Syntax | M66 P- | E- <L-> |
| Dialect | LinuxCNC |
| Name | Description |
|---|---|
| P- | Digital input number from 0 to 3 (adjustable with the motmod num dio argument). |
| E- | Analog input number from 0 to 3 (adjustable with the motmod num aio argument). |
| L- | Wait mode type: 0 IMMEDIATE, 1 RISE, 2 FALL, 3 HIGH, 4 LOW. |
| Q- | Timeout in seconds for waiting; if exceeded, #5399 holds -1. Ignored when L is 0; a Q value of zero is an error when L is non-zero. |