EasyManuals Logo

Omron CPM1 Programming Manual

Omron CPM1
541 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 #331 background imageLoading...
Page #331 background image
310
Special Math Instructions Section 5-22
The following diagram shows the function of words D to D+N+1.
Precautions The average value is calculated in binary. Be sure that the content of S is in
binary.
N must be BCD from #0001 to #0064. If the content of N
#0065, AVG(––)
will operate with N=64.
The average value will be rounded off to the nearest integer value. (0.5 is
rounded up to 1.)
Leave the contents of D+1 set to #0000 after the first execution of AVG(––).
Flags ER: Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
One or more operands have been set incorrectly.
D and D+N+1 are not in the same data area.
Example In the following example, the content of IR 040 is set to #0000 and then incre-
mented by 1 each cycle. For the first two cycles, AVG(––) moves the content
of IR 040 to DM 1002 and DM 1003. On the third and later cycles AVG(––)
calculates the average value of the contents of DM 1002 to DM 1004 and
writes that average value to DM 1000.
D Average value (after N or more executions)
D+1 Used by the system.
D+2 Content of S from the 1
st
execution of AVG(––)
D+3 Content of S from the 2
nd
execution of AVG(––)
D+N+1 Content of S from the N
th
execution of AVG(––)
@MOV(21)
040
#0000
00001
Address Instruction Operands
00000 LD 00001
00001 @MOV(21)
# 0000
040
00002 AVG(––)
040
# 0003
DM 1000
00003 CLC(41)
00004 ADB(50)
040
# 0001
040
AVG(––)
#0003
040
DM 1000
CLC(41)
ADB(50)
#0001
040
040
1
st
cycle 2
nd
cycle 3
rd
cycle 4
th
cycle
DM 1000 0000 0001 0001 0002 Average
DM 1001 Used by the system.
DM 1002 0000 0000 0000 0003 Previous
DM 1003 --- 0001 0001 0001 values of
DM 1004 --- --- 0002 0002 IR 40
1
st
cycle 2
nd
cycle 3
rd
cycle 4
th
cycle
IR 040 0000 0001 0002 0003

Table of Contents

Other manuals for Omron CPM1

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CPM1 and is the answer not in the manual?

Omron CPM1 Specifications

General IconGeneral
ModelCPM1
ManufacturerOmron
Instruction SetBasic and advanced instructions
Power Supply100 to 240 VAC or 24 VDC
CommunicationRS-232C
I/O Points10, 20, 30, or 40 points depending on the model
TimersYes, multiple timers available
CountersYes, multiple counters available
Input Voltage24V DC
Output TypeRelay or transistor
Number of I/O Points10, 20, 30, 40
Communication PortsRS-232C (optional)
Operating Temperature0°C to 55°C
Storage Temperature-20°C
Humidity10% to 90% (non-condensing)
DimensionsVaries depending on the model
WeightVaries depending on the model
Program Memory2048 steps (2K steps)

Related product manuals