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 #78 background imageLoading...
Page #78 background image
4 Understanding Programming
4-34
CP2E CPU Unit Software User’s Manual(W614)
It is possible to dynamically specify the offset by specifying a word address in I/O memory for the offset
in the brackets. The contents of the specified word address will be used as the offset.
For example, execution can be performed by increasing the address by incrementing the value in the
brackets and using only one instruction.
z Ladder Program Example
In this example, two areas of consecutive data are used: D0 to D99 and D100 to D199.
The contents of corresponding words are added starting from the specified starting point, W0, to the
end of the areas and the sums are output to D200 to D299 starting from the specified offset from
D200.
For example, if W0 is 30, the corresponding words from D30 to D99 and D130 to D199 are added,
and the sums are output to D230 to D299.
Each process is performed with an input comparison instruction (<) as the execution condition so
that W1 does not exceed &100 to make sure that the upper limit of the indirect addressing range is
not exceeded.
Program so that the memory area of the start address is not exceeded when using a
word address or symbol for the offset.
For example, write the program so that processing is executed only when the indirect
specification does not cause the final address to exceed the memory area by using
an input comparison instruction or other instruction.
If an indirect specification causes the address to exceed the area of the start address,
the system will access data in other area, and unexpected operation may occur.
4-7-2 Application Examples for Address Offsets
Caution
Set the value of W0 to the offset word (W1) using the MOV instruction.
Repeat this process
100 times.
 Use the operand of the addition instruction to specify and execute D0[W1] +
D100[W1] = D200[W1].
 Increment W1 to increase the offset.
MOV
W0
W1
a
FOR
&100
Execution condition
Execution condition
++
W1
a
Starts FOR loop
NEXT
Returns to FOR
+
D0[W1]
D100[W1]
D200[W1]
<
W1
&100
When execution condition a (upwardly
differentiated) turns ON, the value of W0 is
set to W1.
If execution condition a is ON and the
value of W1 is less than &100, the data
from the start position until D99 and
the data until D199 are added, and the
sum for each is output until D299.
While execution condition a is ON, W0 is
incremented.

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