Programming manual.
CNC 8070
STATEMENTS AND INSTRUCTIONS
22.
Programming statements
·419·
(REF: 1709)
22.1.18 Block repetition
This instruction may be used to execute a portion of the program defined between two blocks
which will be identified with labels. The label of the last block must be programmed alone.
Optionally, it is possible to define the number of repetitions of the execution; if not defined,
it will be repeated once.
The number of blocks to be repeated must be defined in the same program or subroutine
from which this instruction is executed. They may also be after the program (after function
M30)
Up to 20 nesting levels are allowed.
#RPT
Block repetition
The programming format is:
#RPT [<blk1>,<blk2>,<n>]
Since the labels to identify the blocks may be of two types (number and name), the #RPT
instruction may be programmed as follows:
• The label is the block number.
In the blocks containing the first and last labels, program the ":" character after the block
number. This is required in every label that is the target of a jump.
• The label is the block name.
Once the repetition is done, the execution resumes at the block after the one containing the
#RPT instruction.
Considerations
The labels of the first and last blocks must be different. To repeat the execution of a single
block, program as follows:
Parameter Meaning
<blk1> First block.
<blk2> Last block.
<n> Optional. Number of repetitions.
N10 #RPT [N50,N70]
N50: G01 G91 X15 F800 (first block)
X-10 Y-10
X20
X-10 Y10
N70: (last block)
N10 #RPT [[BEGIN],[END]]
[BEGIN] G01 G91 F800 (first block)
X-10 Y-10
X20
X-10 Y10
G90
[END] (last block)