171
Index Registers
Section 4-15
4-15-2 Precautions for Using Index Registers
Precautions
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.
++
D0
NEXT
JME
&1
MOVRW
T0
IR0
ON
The PLC memory address for the
PV area for TO is set in IR0.
,IR1+
,IR2+
MOVR
T0
IR1
The PLC memory address for the
Completion Flag for TO is set in IR1.
MOVR
W0.00
IR2
The PLC memory address for W0.00
is set in IR2.
MOV
&100
D0
The value &100 (100 decimal) is
set in D0.
If the above are not set, the FOR to
NEXT loop is not executed, and if
the above are set, the loop is executed.
When indirect addressing for IR2
is OFF, timers are started with indirect
addressing (auto-increment) for IR0 as
the timer number and indirect addressing
for D0 as the timer SV.
Indirect addressing for IR2 will turn ON
(auto-increment) when indirect addressing
for IR1 is ON (auto-increment).
D0 is incremented.
Return to FOR and repeat.
TIM
,IR0+
@D0
FOR
&100
,IR2
TIM
0000
D100
W0.00
T0000
W0.00
TIM
0001
D101
W0.01
T0001
W0.01
TIM
0099
D199
W6.03
T0099
W6.03
JMP
&1
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.
Start of repetition (100 times)
Содержание CP1H-CPU - 05-2006
Страница 1: ...OPERATION MANUAL CP1H CPU Unit SYSMAC CP Series CP1H X40D CP1H XA40D CP1H Y20DT D Cat No W450 E1 02...
Страница 2: ...CP1H X40D CP1H XA40D CP1H Y20DT D CP1H CPU Unit Operation Manual Revised May 2006...
Страница 3: ...iv...
Страница 11: ...xii TABLE OF CONTENTS...
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 31: ...xxxii Conformance to EC Directives 6...
Страница 71: ...40 Function Blocks Section 1 5...
Страница 133: ...102 Computing the Cycle Time Section 2 7...
Страница 169: ...138 CPM1A Expansion I O Unit Wiring Section 3 6...
Страница 411: ...380 Clock Section 6 8...
Страница 519: ...488 Replacing User serviceable Parts Section 10 2...
Страница 527: ...496 Standard Models Appendix A...
Страница 535: ...504 Dimensions Diagrams Appendix B...
Страница 628: ...597 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 629: ...598 Connections to Serial Communications Option Boards Appendix F...
Страница 659: ...628 PLC Setup Appendix G...
Страница 665: ...634 Index work words 159 write protection 370...
Страница 667: ...636 Revision History...