Omron CP1H CPU Operation Manual page 206

Cp1h cpu unit
Hide thumbs Also See for CP1H CPU:
Table of Contents

Advertisement

Index Registers
1,2,3...
Index Register
Initialization
Setting Index Registers
Direct Addressing
172
Regular
data area
address
I/O memory
Note The PLC memory addresses are listed in the diagram above, but it isn't nec-
essary to know the PLC memory addresses when using Index Registers.
Since some operands are treated as word data and others are treated as bit
data, the meaning of the data in an Index Register will differ depending on the
operand in which it is used.
1. Word Operand:
MOVR(560)
MOV(021)
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.
2. Bit Operand:
MOVR(560)
SET
When the operand is treated as a bit, the leftmost 7 digits of the Index Reg-
ister specify the word address and the rightmost digit specifies the bit num-
ber. In this example, MOVR(560) sets the PLC memory address of CIO 13
(0C000D hex) in IR2. The SET instruction adds +5 from bit 13 to this PLC
memory address, so it turns ON bit CIO 1.02.
The Index Registers will be cleared in the following cases:
1. When the operating mode is changed from PROGRAM to RUN or MONI-
TOR mode or vice-versa
2. When the power is cycled
Always set the required value in an index register before using it. The contents
of an index register will be unpredictable if it is not set in advance.
The contents of an index register is also unpredictable after an interrupt task
is started. When using index registers inside an interrupt task, use
MOVR(560) (for anything but timer/counter PVs) or MOVRW(561) (for
timer/counter PVs) to set the required value.
When an Index Register is used as an operand without a "," prefix, the instruc-
tion will operate on the contents of the Index Register itself (a two-word or
"double" value). Index Registers can be directly addressed only in the instruc-
PLC memory
address
#0001
#0020
0000
IR2
D0
, IR2
000013
,IR2
+5 , IR2
Section 4-15
MOVE TO REGISTER instruction
MOVR(560) 0002 IR0
Pointer

Advertisement

Table of Contents
loading

Table of Contents