![Mitsubishi Electric Q172CPU Programming Manual Download Page 391](http://html.mh-extra.com/html/mitsubishi-electric/q172cpu/q172cpu_programming-manual_1811836391.webp)
7 - 130
7 MOTION PROGRAMS FOR POSITIONING CONTROL
7.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
G T n
O
[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.
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 ...