Programming manual.
CNC 8070
STATEMENTS AND INSTRUCTIONS
22.
Flow controlling instructions
·433·
(REF: 1709)
22.2 Flow controlling instructions
22.2.1 Jump to a block ($GOTO)
$GOTO N<EXPRESIÓN>
$GOTO [<ETIQUETA>]
One of the following parameters is defined in this instruction:
This instruction provokes a jump to the block defined with "N<expression>" or "[<label>]",
that may be defined at a point before or after the $GOTO instruction. Program execution
continues after the jump at the indicated block.
The $GOTO instruction may be programmed in two ways:
• With a block number.
In these blocks that are the target of a jump, the label must be programmed followed by ":".
• With a label.
The call instruction and the destination block must be in the same program or subroutine.
There cannot be a jump to a subroutine or between subroutines.
There cannot be jumps to blocks contained in another instruction ($IF, $FOR, $WHILE, etc.)
Although the flow controlling instructions must be programmed alone in the block, the
$GOTO instruction may added to an $IF instruction in the same block. This way, it is possible
to exit the blocks contained in an instruction ($IF, $FOR, $WHILE, etc.) without having to
end the loop.
<expression> It may be a number, parameter or arithmetic expression whose result is a number.
<label> It may be a sequence of up to 14 characters consisting of uppercase and
lowercase letters and numbers (neither blank spaces nor quote marks allowed).
Target N<number>:
Call $GOTO N<number> or N<number>:
Target [<label>]
Call $GOTO [<label>]
N10 $GOTO N60 N40: N10 $GOTO [LABEL]
... ... ...
N60: ... N90 $GOTO N40: N40 [LABEL]
N10 P0=10
N20 $WHILE P0<=10
N30 G01 X[P0*10] F400
N40 P0=P0-1
N50 $IF P0==1 $GOTO N100
N60 $ENDWHILE
N100: G00 Y30
M30