165
Index Registers
Section 4-11
4-11-1 Using Index Registers
Processing of multiple (identical) instructions such as consecutive addresses
for table data can be merged into one instruction by combining repetitive pro-
cessing (e.g., FOR(513) and NEXT(514)instructions) with indirect addressing
using Index Registers, thereby simplifying programming.
The Index operation uses the following procedure.
1.
PLC memory addresses for the addresses in the Index Registers are
stored using a MOVR instruction.
2.
Operation is then executed by indirectly addressing Index Registers to the
operand for Instruction A.
3.
The addresses are moved using processing such as adding, subtracting,
incrementing, or decrementing the Index Register (see note).
4.
Steps 2 and 3 are processed repeatedly until the conditions are met.
Note
Adding, subtracting incrementing, or decrementing for the Index
Register is performed using one of the following methods.
• Each Type of Indirect Addressing for Index Registers:
Auto-increment (,IR
@
+ or ,IR
@
++), auto-decrement (,-IR
@
or ,--IR
@
),
constant offset (constant ,IR
@
), and DR offset (DR
@
,IR
@
) for Index
Registers
• Instructions for Direct Addressing of Index Registers:
DOUBLE SIGNED BINARY ADD WITHOUT CARRY (+L), DOUBLE
SIGNED BINARY SUBTRACT WITHOUT CARRY (-L), DOUBLE IN-
CREMENT BINARY (++L), DOUBLE DECREMENT BINARY (--L)
Example:
If, for example, instruction A above is a comparison instruction, table data
could be read from start to the end of the table to compare all of the data with
a specific value. In this way, blocks of user-defined processing can be freely
created depending by applying Index Registers.
IR0
,IR0
Instruction execution
repeatedly incrementing
IR0 by 1
Instruction
Indirect
addressing
Table data
Instruction A
Instruction A m+1
Instruction A m+n
MOVR m IR0
The PLC memory address
of address m is stored in IR0.
Repeated execution,
e.g., loop for
FOR or NEXT.
Instruction A ,IR0+
Summary of Contents for CP1L CPU UNIT - 03-2009
Page 1: ...Cat No W462 E1 06 CP1L CPU Unit SYSMAC CP Series CP1L L_0D_ CP1L M_0D_ OPERATION MANUAL...
Page 2: ......
Page 4: ...iv...
Page 10: ...x...
Page 22: ...xxii...
Page 34: ...xxxiv Conformance to EC Directives 6...
Page 70: ...36 Function Blocks Section 1 5...
Page 584: ...550 Trouble Shooting Section 8 7...
Page 627: ...593 Sample Application Section 9 12 Network Settings Network Tab Network Settings Driver Tab...
Page 630: ...596 Sample Application Section 9 12...
Page 654: ...620 Troubleshooting Unit Errors Section 11 4...
Page 662: ...628 Replacing User serviceable Parts Section 12 2...
Page 668: ...634 Standard Models Appendix A...
Page 698: ...664 Auxiliary Area Allocations by Function Appendix C...
Page 746: ...712 Auxiliary Area Allocations by Address Appendix D...
Page 773: ...739 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Page 774: ...740 Connections to Serial Communications Option Boards Appendix F...
Page 806: ...772 Index...
Page 808: ...774 Revision History...