If/If Not/Else/Iend - Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual

Table of Contents

Advertisement

IF/IF NOT/ELSE/IEND

Instruction
IF
Branching
IF NOT
ELSE
IEND
Operation without an IF instruction operand (operation by
execution condition)
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
Not allowed
*1 IF(802), ELSE(803), and IEND(804) must be used in block programming regions even within subroutines and interrupt
tasks.
Operands
Operand
B
Bit operand
Operand Specifications
Word addresses
Area
CIO
WR
HR
AR
B
OK
OK
OK
OK
*1 CJ2 CPU Units only.
Flags
Name
Error Flag
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Mnemonic
Variations
---
---
---
---
Execution condition
IF(802)
ELSE(803)
IEND(804)
Block program areas
Step program areas
OK
OK
Description
T
C
DM
EM
1
1
OK
OK
OK*
OK*
Label
ER
• ON if the branch instructions are not in a
• ON if more than 254 branches are
• OFF in all other cases.
Function
code
When the execution condition (when an operand is not
specified) or the specified bit (when an operand is specified)
802
is OFF, the next and following instructions are executed.
When ON, instructions up to ELSE are disregarded.
When the specified bit is ON, the next and following
802
instructions are executed. When OFF, instructions up to
ELSE are disregarded.
Indicates the beginning of the block that is executed when IF
803
is false.
804
Indicates the end of the conditional branch block area.
Operation with an IF (IF NOT) instruction operand
IF(802)
IF NOT(802) B
ELSE(803)
IEND(804)
Subroutines
1
OK*
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
---
---
IF/IF NOT
block program.
nested.
3. Instructions
Function
B
B: Bit operand
B: Bit operand
B
B: Bit operand
B
B: Bit operand
SFC action or transition
Interrupt tasks
programs
1
Not allowed
OK*
Data type
BOOL
Registers
Flags
Pulse
Indirect
IR
TK
CF
using IR
---
OK
OK
OK
Operation
ELSE/IEND
• ON if the branch instructions are not in a
block program.
• OFF in all other cases.
3
Size
1
TR
bits
bits
OK
---
1047

Advertisement

Table of Contents
loading

Table of Contents