Index Registers - Omron CJ2 CPU UNIT SOFTWARE User Manual

Cj2 cpu unit software
Hide thumbs Also See for CJ2 CPU UNIT SOFTWARE:
Table of Contents

Advertisement

6 I/O Memory Areas

6-19 Index Registers

The sixteen Index Registers (IR0 to IR15) are used for indirect addressing. Each Index Register can
hold a single PLC memory address, which is the absolute memory address of a word in I/O memory.
These are different from the I/O memory area addresses in the CIO Area, DM Area, etc. They are the
continuous RAM addresses.
Index Registers can be used either independently in each task or shared by all the tasks.
The user cannot directly input PLC memory addresses in the Index Registers. Use MOVR(560) to con-
vert a regular data area address to its equivalent PLC memory address and write that value to the spec-
ified Index Register. (Use MOVRW(561) to set the PLC memory address of a timer/counter PV in an
Index Register.)
Additional Information
Refer to A-4 Memory Map of PLC Memory Addresses for more details on PLC memory
addresses.
Indirect Addressing
When an Index Register is used as an operand with a "," prefix, the instruction will operate on the
word indicated by the PLC memory address in the Index Register, not the Index Register itself. Basi-
cally, the Index Registers are I/O memory pointers.
• All addresses in I/O memory (except Index Registers, Data Registers, and Condition Flags) can
be specified seamlessly with PLC memory addresses. It isn't necessary to specify the data area.
• In addition to basic indirect addressing, the PLC memory address in an Index Register can be off-
set with a constant or Data Register, auto-incremented, or auto-decremented. These functions
can be used in loops to read or write data while incrementing or decrementing the address by one
each time that the instruction is executed.
With the offset and increment/decrement variations, the Index Registers can be set to base values
with MOVR(560) or MOVRW(561) and then modified as pointers with each instruction execution.
For pointer operation, either special instructions that can directly specify Index Registers
(MOVR(560), MOVRW(561), increment instructions, decrement instructions, or math instructions)
are used, or indirect offsets, auto-incrementing, or auto-decremented is used.
Set to a base value
with MOVR(560) or
MOVRW(561).
You can set the PLC to use index registers independently in each task or to share them between all
tasks.
Index registers are cleared at the following times:
• When the operating mode is changed between PROGRAM or MONITOR mode and RUN mode
• When the power supply to the PLC is turned ON
• When a fatal error occurs (except for fatal errors created with FALS(007)
6-36
I/O Memory
Pointer
CJ2 CPU Unit Software User's Manual

Advertisement

Table of Contents
loading

Table of Contents