EasyManuals Logo

Omron CJ2 CPU UNIT SOFTWARE User Manual

Omron CJ2 CPU UNIT SOFTWARE
670 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #178 background imageLoading...
Page #178 background image
5 Understanding Programming
5-86
CJ2 CPU Unit Software User’s Manual
5-7 Index Registers
Index Registers function as pointers to specify PLC memory addresses, which are absolute memory
addresses in I/O memory. After storing a PLC memory address in an Index Register with MOVR(560) or
MOVRW(561), input the Index Register as an operand in other instructions to indirectly address the
stored PLC memory address.
The advantage of Index Registers is that they can specify any bit or word in I/O memory, including timer
and counter PVs.
Index Registers can be a powerful tool when combined with loops such as FOR-NEXT loops. The con-
tents of Index Registers can be incremented, decremented, and offset very easily, so a few instructions
in a loop can process tables of consecutive data very efficiently.
Basically, Index Registers are used with the following steps:
1 Use MOVR(560) to store the PLC memory address of the desired bit or word in an Index Regis-
ter.
2 Specify the Index Register as the operand in almost any instruction to indirectly address the
desired bit or word.
3 Offset or increment the original PLC memory address (see below) to redirect the pointer to
another address.
4 Continue steps 2 and 3 to execute the instruction on any number of addresses.
Note Use any of the following methods to offset or increment an Index Register.
• Indirect Addressing of Index Registers:
Indirect addressing with auto-incrementing (,IR@+ or ,IR@++), indirect addressing with
auto-decrementing (,−IR@ or ,−−IR@), indirect referencing with a constant offset (con-
stant,IR@), indirect addressing with a DR offset (DR@,IR@)
5-7-1 What Are Index Registers?
5-7-2 Using Index Registers
IR
MOVR(560)
Index Register
Pointer
All areas of
I/O Memory
IR0
,
IR0
Indirect
addressing
Increment IR0 and repeat
instruction execution
Table data
Instruction

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CJ2 CPU UNIT SOFTWARE and is the answer not in the manual?

Omron CJ2 CPU UNIT SOFTWARE Specifications

General IconGeneral
BrandOmron
ModelCJ2 CPU UNIT SOFTWARE
CategorySoftware
LanguageEnglish

Related product manuals