Mitsubishi Electronics Q173HCPU/Q172HCPU Work Light User Manual


 
6 - 130
6 MOTION PROGRAMS FOR POSITIONING CONTROL
6.16.1 Program control function (IF, GOTO statement)
Code IF, GOTO
Function Program control function
The flow of execution program is controlled based on the condition.
Format
F
Sequence No.
I[
expression
]
;
O
GT nO
[Explanation]
(1) If the specified expression is true (1) (condition is satisfied), execution jumps to the
sequence No. specified in GOTO.
If the expression is false (0), the next line is executed.
IF [#@100 EQ1] GOTO100 ;
If #@100 is 1, execution jumps to N100.
If it is other than 1, the next line is executed.
IF [#@100] GOTO100 ;
If #@100 is 1 (true), execution jumps to N100.
If it is 0 (false), the next line is executed.
(2) The following comparison instructions may be used in the expression.
Code Meaning
EQ Equal to (=)
NE Not equal to (!=)
GT Greater than (>)
LT Less than (<)
GE Greater than or equal to (>=)
LE Less than or equal to (<=)
(3) The expression must be enclosed in "[", "]".
(4) The line number specified in GOTO must exist in the same program. If it does not
exist, an error (error code : 541) occurs.
(5) If only GOTOn is specified, execution jumps to the specified sequence No.
unconditionally.
(6) The GOTO statement cannot cause execution to go into or come out of the THEN
and ELSE statements.
It is similar for the DO statement.