167
Index Registers
Section 4-11
4-11-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)
Содержание CP1L CPU UNIT - 03-2009
Страница 1: ...Cat No W462 E1 06 CP1L CPU Unit SYSMAC CP Series CP1L L_0D_ CP1L M_0D_ OPERATION MANUAL...
Страница 2: ......
Страница 4: ...iv...
Страница 10: ...x...
Страница 22: ...xxii...
Страница 34: ...xxxiv Conformance to EC Directives 6...
Страница 70: ...36 Function Blocks Section 1 5...
Страница 584: ...550 Trouble Shooting Section 8 7...
Страница 627: ...593 Sample Application Section 9 12 Network Settings Network Tab Network Settings Driver Tab...
Страница 630: ...596 Sample Application Section 9 12...
Страница 654: ...620 Troubleshooting Unit Errors Section 11 4...
Страница 662: ...628 Replacing User serviceable Parts Section 12 2...
Страница 668: ...634 Standard Models Appendix A...
Страница 698: ...664 Auxiliary Area Allocations by Function Appendix C...
Страница 746: ...712 Auxiliary Area Allocations by Address Appendix D...
Страница 773: ...739 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 774: ...740 Connections to Serial Communications Option Boards Appendix F...
Страница 806: ...772 Index...
Страница 808: ...774 Revision History...