Programming manual
CNC 8055
CNC 8055i
PROGRAM CONTROL INSTRUCTIONS
14.
·M· & ·EN· MODELS
SOFT: V02.2X
·399·
Flow control instructions
14.4 Flow control instructions
The GOTO and RPT instructions cannot be used in programs that are executed from a PC connected
through the serial line.
( GOTO N(expression) )
The mnemonic GOTO causes a jump within the same program, to the block defined by the label
N(expression). The execution of the program will continue after the jump, from the indicated block.
The jump label can be addressed by means of a number or by any expression which results in a
number.
( RPT N(expression), N(expression), P(expression) )
The mnemonic RPT executes the part of the program between the blocks defined by means of the
labels N(expression). The blocks to be executed may be in the execution program or in a RAM
memory program.
The label P(expression) indicates the number of the program containing the blocks to be executed.
If not defined, the CNC interprets that the portion to be repeated is located in the same program.
All the labels can be indicated by means of a number or by any expression which results in a number.
The part of the program selected by means of the two labels must belong to the same program, by
first defining the initial block and then the final block.
The execution of the program will continue in the block following the one in which the mnemonic
RPT was programmed, once the selected part of the program has been executed.
(IF condition <action1> ELSE <action2>)
This instruction analyzes the given condition that must be a relational expression. If the condition
is true (result equal to 1), <action1> will be executed, otherwise (result equal to 0) <action2> will
be executed.
Example:
(IF (P8 EQ 12.8) CALL 3 ELSE PCALL 5, A2, B5, D8)
If P8 = 12.8 executes the mnemonic (CALL3)
If P8<>12.8 executes the mnemonic (PCALL 5, A2, B5, D8)
The instruction can lack the ELSE part, i.e., it will be enough to program IF condition <action1>.
Example:
(IF (P8 EQ 12.8) CALL 3)
G00 X0 Y0 Z0 T2 D4
X10
(GOTO N22) ; Jump instruction
X15 Y20 ; It is not executed
Y22 Z50 ; It is not executed
N22 G01 X30 Y40 Z40 F1000 ; Continues execution in this block
G02 X20 Y40 I-5 J-5
...
N10 G00 X10
Z20
G01 X5
G00 Z0
N20 X0
N30 (RPT N10, N20) N3
N40 G01 X20
M30
When reaching block N30, the program will execute section N10-N20 three times.
Once this has been completed, the program will continue execution in block N40.
Since the RPT instruction does not interrupt block preparation or tool compensation, it may be used
when using the EXEC instruction and while needing to maintain tool compensation active.