Omron CJ - PROGRAMMING MANUAL 12-2009 Programming Manual page 325

Programmable controllers
Table of Contents

Advertisement

Index Registers
Instruction group
Data Movement Instruc-
tions
Table Data Processing
Instructions
Data Movement Instruc-
tions
Comparison Instructions
The 11-instruction subroutine on the left is equivalent to the 200-instruction
subroutine on the right.
Execution condition
a
Execution condition
a
Direct Addressing of Index Registers
Index Registers can be directly addressed only in the instructions shown in
the following table.
Instruction name
MOVE TO REGISTER
MOVE TIMER/COUNTER PV TO REG-
ISTER
SET RECORD LOCATION
GET RECORD NUMBER
DOUBLE MOVE
DOUBLE DATA EXCHANGE
DOUBLE EQUAL
DOUBLE NOT EQUAL
DOUBLE LESS THAN
DOUBLE LESS THAN OR EQUAL
DOUBLE GREATER THAN
DOUBLE GREATER THAN OR EQUAL
DOUBLE COMPARE
When execution condition "a" goes
MOVR
ON (upwardly differentiated
D00000
condition), the PLC memory
addresses of D00000, D00100, and
IR0
D00200 are set in index registers IR0,
IR1, and IR2.
The following FOR-NEXT loop is not
MOVR
executed unless execution condition
D00100
"a" is upwardly differentiated
(OFF→ON).
IR1
MOVR
D00200
IR2
JMP
&1000
Start loop.
FOR
&100
If execution condition "a" is ON, the
+
word indirectly addressed by IR0
,IR0+
(auto-incremented) and the word
indirectly addressed by IR1 (auto-
,IR1+
incremented) are added as 4-digit
,IR2+
signed hexadecimal values and the
result is output to the word indirectly
addressed by IR2 (auto-incremented).
Return to FOR and repeat loop.
NEXT
Jump destination when execution
JME
condition "a" is not upwardly
&1000
differentiated (OFF→ON).
Mnemonic
Primary function
MOVR(560)
Stores the PLC memory address
of a bit or word in an Index Regis-
MOVRW(561)
ter.
SETR(635)
GETR(636)
Outputs the PLC memory address
stored in an Index Register.
MOVL(498)
Transfers between Index Regis-
ters. Used for exchanges and com-
XCGL(562)
parisons.
=L(301)
< >L(306)
< L(311)
< =L(316)
>L(321)
>=L(326)
CMPL(060)
Section 6-2
285

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents