Omron CJ2 - 02-2010 User Manual page 239

Cj2 cpu unit software
Table of Contents

Advertisement

Note The PLC memory addresses are listed in the diagram above, but it isn't necessary to know the PLC memory
addresses when using Index Registers.
Some operands are treated as word data and others are treated as bit data, so the meaning of the
data in an Index Register will differ depending on the operand in which it is used.
• Word Operand:
MOVR(560) 0 IR2
MOV(021) D0 , IR2
When the operand is treated as a word, the contents of the Index Register are used "as is" as the
PLC memory address of a word. In this example MOVR(560) sets the PLC memory address of
CIO 2 in IR2 and the MOV(021) instruction copies the contents of D0 to CIO 2.
• Bit Operand:
MOVR(560) 0.13 ,IR2
SET +5 , IR2
Index registers can also be used to specify bits, like in the SET instruction above. In this example,
MOVR(560) sets the PLC memory bit address of CIO 0.13 in IR2. The SET instruction adds +5 from
bit 13 to this PLC memory address, so it turns ON bit CIO 1.02.
Additional Information
When MOVR(560) is used to set a word address in an index register, the address is stored as
follows:
When MOVR(560) is used to set a bit address in an index register, the address is stored as fol-
lows:
CJ2 CPU Unit Software User's Manual
31
Index register
PLC memory address
31
Index register
PLC memory address
6 I/O Memory Areas
0
4 3
0
Bit number
6
6-37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents