Omron SYSMAC CS Series Operation Manual page 504

Programmable controllers
Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

Index Registers
Variation
Indirect addressing
The content of IR@ is treated as
the PLC memory address of a bit
or word.
Indirect addressing
The constant prefix is added to the
with constant offset
content of IR@ and the result is
treated as the PLC memory
address of a bit or word.
The constant may be any integer
from –2,048 to 2,047.
Indirect addressing
The content of the Data Register
with DR offset
is added to the content of IR@ and
the result is treated as the PLC
memory address of a bit or word.
Indirect addressing
After referencing the content of
with auto-increment
IR@ as the PLC memory address
of a bit or word, the content is
incremented by 1 or 2.
Indirect addressing
The content of IR@ is decre-
with auto-decrement
mented by 1 or 2 and the result is
treated as the PLC memory
address of a bit or word.
Example
466
The following table shows the variations available when indirectly addressing
I/O memory with Index Registers. (IR@ represents an Index Register from IR0
to IR15.)
Function
This example shows how to store the PLC memory address of a word
(CIO 0002) in an Index Register (IR0), use the Index Register in an instruc-
tion, and use the auto-increment variation.
MOVR(560)
MOV(021)
MOV(021)
Regular
data area
address
I/O memory
Note
1. Auto-incrementing and auto-decrementing for index registers are per-
formed whenever an instruction using them is executed. Care is required
in application, particularly with instructions like OUT, which are executed
Syntax
,IR@
LD ,IR0
Constant ,IR@
LD +5,IR0
(Include a + or –
in the constant.)
DR@,IR@
LD
DR0,IR0
Increment by 1:
LD , IR0++
,IR@+
Increment by 2:
,IR@++
Decrement by 1:
LD , – –IR0 Decrements the content of
,–IR@
Decrement by 2:
,– –IR@
0002
IR0
Stores the PLC memory address of
CIO 0002 in IR0.
#0001
,IR0
Writes #0001 to the PLC memory ad-
dress contained in IR0.
#0020
+1,IR0 Reads the content of IR0, adds 1,
and writes #0020 to that PLC memo-
ry address.
PLC memory address
#0001
#0020
Section 9-22
Example
Loads the bit at the PLC
memory address contained
in IR0.
Adds 5 to the contents of IR0
and loads the bit at that PLC
memory address.
Adds the contents of DR0 to
the contents of IR0 and
loads the bit at that PLC
memory address.
Loads the bit at the PLC
memory address contained
in IR0 and then increments
the content of IR0 by 2.
IR0 by 2 and then loads the
bit at that PLC memory
address.
MOVE TO REGISTER instruction
MOVR(560) 0002 IR0
Pointer

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs1g/h-cpu_hCs1g/h-cpu_-ev1

Table of Contents