Advanced Function Instruction
7-1
FUN22 P
BREAK
BREAK FROM FOR AND NEXT LOOP
(BREAK)
FUN22 P
BREAK
● When execution control〝EN〞=1 or〝EN↑〞( P instruction)changes from 0→1,it will terminate the FOR
and NEXT program loop。
● The program within the FOR and NEXT loop will be executed N times (N is assigned by FOR instruction)
successively,but if it is necessary to terminate the execution loop less than N times,the BREAK instruction
is necessary to apply。
● The BREAK instruction must be located within the FOR and NEXT program loop。
Sa :
Sb :
a=b
M200
RST
V
M200
R0V
FOR
EN
70
EN
17.CMP
BREAK
EN
(+1)
VEN
NEXT
71
EN
08.MOV
15
D100
a>b
a<b
OVF
S :
D :
D1000
V
D10
Description:The loop count used to execute the FOR and NEXT program loop is assigned by register D10;the
program within the FOR and NEXT loop is designed to search the same data storing in D100 from the
register table starting at R0。If it finds,the searching loop will be terminated and then it goes to execute
the program after the NEXT instruction;If it doesn't find,the searching loop will be executed N times (N
is the content of D10) and then it goes to execute the program after the NEXT instruction。
M200 tells the status and D1000 is the pointer of searching。