![background image](http://html.mh-extra.com/html/omron/sysmac-cp-series/sysmac-cp-series_user-manual_742262073.webp)
4-29
4 Understanding Programming
CP2E CPU Unit Software User’s Manual(W614)
4-6 In
de
x
Register
s
4
4-6-2 U
s
ing Inde
x Registers
The data in D0 to D99 (augend data) is added to the data in D100 to D199 (addend data) and the addi-
tion results are output to D200 to D299. The operands of a single addition instruction are specified by
index registers and the addition operations are performed by incrementing the index registers and
repeatedly executing the addition instruction.
Additional Information
Index Registers can be directly addressed only in the instructions shown in the following table.
Application Example for Index Registers
MOVR
D0
IR0
a
MOVR
D100
IR1
MOVR
D200
IR2
FOR
&100
+
,IR0+
,IR1+
,IR2+
a
NEXT
JME
&50
JMP
&50
MOVR(560)
s
et
s
the PLC memory
a
ddre
ss
e
s
of D0, D100,
a
nd D200 in
index regi
s
ter
s
IR0, IR1,
a
nd IR2.
The
au
gend d
a
t
a
(indirectly
a
ddre
ss
ed
b
y IR0+) i
s
a
dded to the
a
ddend
d
a
t
a
(indirectly
a
ddre
ss
ed
b
y IR1+) with the
S
IGNED BINARY ADD
WITHOUT CARRY in
s
tr
u
ction (+(400))
a
nd the re
su
lt i
s
o
u
tp
u
t to the word
indirectly
a
ddre
ss
ed
b
y IR2+.
Index regi
s
ter
s
IR0+, IR1+,
a
nd IR2+
a
re
au
tom
a
tic
a
lly incremented
a
fter
b
eing referenced in the +(400) in
s
tr
u
ction.
Repe
a
ted 100 time
s
.
When exec
u
tion condition
“a”
goe
s
ON
(
u
pw
a
rdly differenti
a
ted condition), the
PLC memory
a
ddre
ss
e
s
of D0, D100,
a
nd D200
a
re
s
et in index regi
s
ter
s
IR0,
IR1,
a
nd IR2.
The following FOR-NEXT loop i
s
not
exec
u
ted
u
nle
ss
exec
u
tion condition
“a”
i
s
u
pw
a
rdly differenti
a
ted (OFF
→
ON).
S
t
a
rt loop.
If exec
u
tion condition
“a”
i
s
ON, the
word indirectly
a
ddre
ss
ed
b
y IR0
(
au
to-incremented)
a
nd the word
indirectly
a
ddre
ss
ed
b
y IR1
(
au
to-incremented)
a
re
a
dded
as
4-digit
s
igned hex
a
decim
a
l v
a
l
u
e
s
a
nd the
re
su
lt i
s
o
u
tp
u
t to the word indirectly
a
ddre
ss
ed
b
y IR2 (
au
to-incremented).
Ret
u
rn to FOR
a
nd repe
a
t loop.
J
u
mp de
s
tin
a
tion when exec
u
tion
condition
“a”
i
s
not
u
pw
a
rdly
differenti
a
ted (OFF
→
ON).
Exec
u
tion condition
Exec
u
tion condition
Содержание SYSMAC CP Series
Страница 1: ...USER S MANUAL Cat No W614 E1 01 SYSMAC CP Series CP2E E D CP2E S D CP2E N D CP2E CPU Unit Software ...
Страница 3: ......
Страница 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Страница 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Страница 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Страница 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Страница 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Страница 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Страница 577: ......