O-code looping is a flow-control instruction in NC programs that repeats a group of blocks while a condition is true. It supports while/endwhile loops, which test the condition before each iteration, and do/while loops, which test after each iteration. O-break exits the loop immediately and O-continue skips to the next condition test.
| Language | gcode |
|---|---|
| Code | O while |
| Group | flow control |
| Syntax | o<number> while [condition] ... o<number> endwhile; o<number> do ... o<number> while [condition] |
| Dialect | rs274ngc |