{"id":"ocode-repeat","model_id":"repeat","name":"O-code Repeat","summary":"The O-code repeat is a flow-control instruction for NC programs. It executes the statements between a matching repeat and endrepeat a specified number of times. The same O-number labels both the repeat and endrepeat lines.","study_notes":["O-codes use the letter O, not the digit zero, as the first character, such as O100 or o100.","The repeat count is shown in square brackets in the example o103 repeat [5].","The example uses repeat/endrepeat to mill 5 diagonal shapes starting at the present position.","The repeat and endrepeat lines share the same O-number label.","A label on endrepeat that does not refer to a corresponding repeat causes an error message and aborts the interpreter."],"safety_notes":[],"sources":[{"url":"https://linuxcnc.org/docs/html/gcode/o-code.html#ocode:repeat","title":"O Codes","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":3,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"gcode","code":"repeat","group":"flow control","syntax":"o103 repeat [5] ... o103 endrepeat","parameters":[],"dialect":"rs274ngc","related":[],"standards":[]},"url":"https://machineschema.com/instruction/ocode-repeat","license":"https://creativecommons.org/licenses/by/4.0/"}