![Mitsubishi Electric Q172CPU Programming Manual Download Page 393](http://html.mh-extra.com/html/mitsubishi-electric/q172cpu/q172cpu_programming-manual_1811836393.webp)
7 - 132
7 MOTION PROGRAMS FOR POSITIONING CONTROL
7.16.2 Program control function (IF, THEN, ELSE, END statements)
Code
IF, THEN, ELSE, END
Function
Program control function
The flow of execution program is controlled based on the condition.
Format
F
IF identification number
(1 to 32)
I
[
]
L
E
Em;
S
Block U group
E Dm ;
N
Block U group
expression
;
H
T E m
N
[Explanation]
(1) If the specified expression is true (1) (condition is satisfied), the THEN statement
(block group up to ELSE) is executed. If it is false (0) (condition is not satisfied),
the ELSE statement (block group up to END) is executed.
IF [#@100 EQ1] THEN1 ;
If #@100 is 1, the block group described here is executed.
ELSE1 ;
If #@100 is not 1, the block group described here is executed.
END1 ;
(2) When ELSE is omitted, the block group up to END is executed only if the
conditional expression is true.
IF [#@100 EQ1] THEN1 ;
If #@100 is 1, the block group described here is executed.
END1 ;
(3) The multiprogramming depth is up to three levels including that of the WHILE
statement.
IF [ ] THEN1 ;
IF [ ] THEN2 ;
IF [ ] THEN3 ;
END3 ;
END2 ;
END1 ;
(4) The GOTO statement cannot cause execution to go into or come out of the THEN
and ELSE statements.
Summary of Contents for Q172CPU
Page 229: ...5 88 5 POSITIONING DEDICATED SIGNALS MEMO ...
Page 447: ...7 186 7 MOTION PROGRAMS FOR POSITIONING CONTROL MEMO ...
Page 535: ...8 88 8 AUXILIARY AND APPLIED FUNCTIONS MEMO ...
Page 557: ...11 10 11 COMMUNICATIONS VIA NETWORK MEMO ...
Page 559: ...12 2 12 MONITOR FUNCTION OF THE MAIN CYCLE MEMO ...