Omron CJ - INSTRUCTIONS Reference Manual page 1105

Table of Contents

Advertisement

Function
Operation without an Operand for IF(802)
If an operand bit is not specified, an execution
must be created before IF(802) starting with
LD. If the execution condition is ON, the
instructions between IF(802) and ELSE(803)
will be executed and if the execution condition
is OFF, the instructions between ELSE(803)
and IEND(804) will be executed.
If the ELSE(803) instruction is omitted and the
execution condition is ON, the instructions
between IF(802) and IEND(804) will be
executed and if the execution condition is
OFF, only the instructions after IEND(804) will
be executed.
Operation with an Operand for IF(802) or IF NOT(802)
An operand bit, B, can be specified for IF(802)
or IF NOT(802). If the operand bit is ON, the
instructions between IF(802) and ELSE(803)
will be executed. If the operand bit is OFF, the
instructions
between
IEND(804) will be executed. For IF NOT(802),
the
instructions
ELSE(803) will be executed and if the
operand bit is ON, the instructions be
ELSE(803) and IEND(804) will be executed is
the operand bit is OFF.
If the ELSE(803) instruction is omitted and the
operand bit is ON, the instructions between
IF(802) and IEND(804) will be executed and if
the operand bit is OFF, only the instructions
after IEND(804) will be executed. The same
will happen for the opposite status of the
operand bit if IF NOT(802) is used.
* The parentheses ( ) in the explanation indicate
the case of the IF NOT instruction.
Hint
• Instructions in block programs are generally executed unconditionally. Branching, however, can be
used to create conditional execution based on execution conditions or operand bits.
Use IF A ELSE B IEND to branch between A and B.
Use IF A IEND to branch between A and doing nothing.
• Nesting Branches
• Up to 253 branches can be nested within the top level branch.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
ELSE(803)
and
between
IF(802)
and
Execution
Execution
condition
condition ON?
"A" executed (be-
tween IF and ELSE).
Execution
condition
IF R (IF NOT R)
Operand bit
A
ON (OFF)*?
ELSE
B
"A" executed (be-
tween IF and ELSE).
IEND
Operand bit
ON (OFF)*?
"A" executed (be-
tween IF and IEND).
3. Instructions
"B" executed
(after ELSE).
Execution
condition ON?
"A" executed (be-
tween IF and IEND).
"B" executed
(after ELSE).
1067
3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents