EasyManuals Logo
Home>Omron>Computer Hardware>SYSMAC CP2E-N D Series

Omron SYSMAC CP2E-N D Series User Manual

Omron SYSMAC CP2E-N D Series
578 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #99 background imageLoading...
Page #99 background image
5-19
5 I/O Memory
CP2E CPU Unit Software User’s Manual(W614)
5-8 Index Registers (IR)
5
Example
This example shows how to store the PLC memory address of a word (CIO 2) in an Index Register
(IR0), use the Index Register in an instruction, and use the auto-increment variation.
MOVR 2 IR0 Stores the PLC memory address of CIO 2 in IR0.
MOV #0001 ,IR0 Writes #0001 to the PLC memory address contained in IR0.
MOV #0020 +1,IR0 Reads the content of IR0, adds 1, and writes #0020 to that PLC
memory address.
Note The PLC memory addresses are listed in the diagram above, but it isnt necessary to know the
PLC memory addresses when using Index Registers.
Since some operands are treated as word data and others are treated as bit data, the meaning of the
data in an Index Register will differ depending on the operand in which it is used.
Word Operand:
MOVR 0000 IR2
MOV D0 ,IR2
When the operand is treated as a word, the contents of the Index Register are used “as is” as the
PLC memory address of a word.
In this example MOVR sets the PLC memory address of CIO 2 in IR2 and the MOV instruction copies
the contents of D0 to CIO 2.
Bit Operand:
MOVR 000013 ,IR2
SET +5 , IR2
When the operand is treated as a bit, the leftmost 7 digits of the Index Register specify the word
address and the rightmost digit specifies the bit number. In this example, MOVR sets the PLC mem-
ory address of CIO 13 (0C00D hex) in IR2. The SET instruction adds +5 from bit 13 (D hex) to this
PLC memory address, so it turns ON bit CIO 1.02.
Additional Information
When MOVR is used to set a word address in an index register, the address is stored as follows:
When MOVR is used to set a bit address in an index register, the address is stored as follows:
#0001
#0020
Regular
data area
address
I/O memory
PLC memory
address
MOVE TO REGISTER
instruction MOVR(560) 0002 IR0
Pointer
0000
0001
0002
0003
0289
H000
H127
W000
W127
IR0
MOV #0001 ,IR0
01B80Hex
01B81Hex
01B82Hex
01B83Hex
01CA1Hex
01CC0Hex
01D3FHex
W000
0233FHex
022C0Hex
01B82Hex
W000
PLC memory address
31 0
Index register
31 4 3 0
PLC memory address
Index register Bit number

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron SYSMAC CP2E-N D Series and is the answer not in the manual?

Omron SYSMAC CP2E-N D Series Specifications

General IconGeneral
BrandOmron
ModelSYSMAC CP2E-N D Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals