Omron CP1L Operation Manual page 199

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

Advertisement

Index Registers
Example:
Instruction A
Instruction A m+1
Instruction A m+n
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.
■ Example Using Index Registers
In the following example, TIM instructions for timer numbers 0 to 99 use set
values in D100 to D199. This can be achieved by using one TIM instruction,
using an index register for the timer number, using another index register for
the Completion Flags, and repeatedly executing the TIM instruction to start
the timers.
The PLC memory addresses for each T0's PV, Completion
Flag, and W0.00 are set in Index Registers IR0, IR1, and IR2 using a
MOVRW or MOVR instruction.
- The TIM instruction is executed for the timer number
(timer PV) that IR0+ indirectly addresses.
- The Timer Completion Flag that is indirectly addressed for
IR1+ turns ON when the time elapses. When the ON status
is received, bits in the work area that are indirectly
addressed for IR2+ are turned ON.
- The contents of IR0+, IR1+, and IR2+ are automatically
incremented by one after accessing the values using indirect
addressing.
- D0 is incremented.
The PLC memory address
of address m is stored in IR0.
MOVR m IR0
Repeated execution,
e.g., loop for
Instruction A ,IR0+
FOR or NEXT.
Section 4-11
Repeated
165

Advertisement

Table of Contents
loading

Table of Contents