Mitsubishi Electronics Q173HCPU/Q172HCPU Work Light User Manual


 
6 - 132
6 MOTION PROGRAMS FOR POSITIONING CONTROL
6.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[
]
LEE
m
;
S
Block U group
ED
m;N
Block U group
expression
;
H
T E mN
[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.