4-11-2 Precautions For Using Index Registers - Omron CP1L Operation Manual

Sysmac cp series
Hide thumbs Also See for CP1L:
Table of Contents

Advertisement

Index Registers
,IR2
,IR1+
ON
Repeat execution of TIM instructions 100 times while incrementing each value for IR0
(timer number, PV), IR1 (Completion Flag), IR2 (W0.00 on), and @D0, and start T0 to T99.

4-11-2 Precautions for Using Index Registers

Precautions
166
MOVRW
The PLC memory address for the
PV area for TO is set in IR0.
T0
IR0
MOVR
The PLC memory address for the
Completion Flag for TO is set in IR1.
T0
IR1
MOVR
The PLC memory address for W0.00
is set in IR2.
W0.00
IR2
MOV
The value &100 (100 decimal) is
set in D0.
&100
D0
If the above are not set, the FOR to
JMP
NEXT loop is not executed, and if
&1
the above are set, the loop is executed.
FOR
Start of repetition (100 times)
&100
When indirect addressing for IR2
TIM
is OFF, timers are started with indirect
addressing (auto-increment) for IR0 as
,IR0+
the timer number and indirect addressing
@D0
for D0 as the timer SV.
,IR2+
Indirect addressing for IR2 will turn ON
(auto-increment) when indirect addressing
for IR1 is ON (auto-increment).
++
D0 is incremented.
D0
Return to FOR and repeat.
NEXT
JME
&1
Do not use a Index Register until a PLC memory address has been set in the
register. The pointer operation will be unreliable if the registers are used with-
out setting their values.
The values in Index Registers are unpredictable at the start of an interrupt
task. When an Index Register will be used in an interrupt task, always set a
PLC memory address in the Index Register with MOVR(560) or MOVRW(561)
before using the register in that task.
Each Index Register task is processed independently, so they do not affect
each other. For example, IR0 used in Task 1 and IR0 used in Task 2 are differ-
ent. Consequently, each Index Register task has 16 Index Registers.
Section 4-11
W0.00
T0000
W0.01
T0001
W6.03
T0099
TIM
0000
D100
W0.00
TIM
0001
D101
W0.01
TIM
0099
D199
W6.03

Advertisement

Table of Contents
loading

Table of Contents