Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 496

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Special Math Instructions
7-23-5 SUM – SUM(––)
Limitations
Description
15
C:
Number of Items in Range
Addition Units
478
Ladder Symbols
SUM(––)
C
R
1
D
This instruction is available in the CPM2A/CPM2C only.
The 3 rightmost digits of C must be BCD between 001 and 999.
DM 6144 to DM 6655 cannot be used for D.
If bit 14 of C is OFF (setting for BCD data), all data within the range R
must be BCD.
When the execution condition is OFF, SUM(––) is not executed. When the
execution condition is ON, SUM(––) adds either the contents of words R
R
+N–1 or the bytes in words R
1
tination words (D and D+1). The data can be summed as binary or BCD and will
be output in the same form. Binary data can be either signed or unsigned.
The function of bits in C are shown in the following diagram and explained in
more detail below.
14
13
12
11
Data type
1 (ON):
Binary
0 (OFF): BCD
Not used – set to zero.
The number of items within the range (N) is contained in the 3 rightmost digits of
C, which must be BCD between 001 and 999. This number will indicate the num-
ber of words or the number of bytes depending the items being summed.
Words will be added if bit 13 is OFF and bytes will be added if bit 13 is ON.
If bytes are specified, the range can begin with the leftmost or rightmost byte of
R
. The leftmost byte of R
1
@SUM(––)
C
R
1
D
to R
+N/2–1 and outputs that value to the des-
1
1
00
Number of items in range (N, BCD)
Number of words or number of bytes
001 to 999
First byte (when bit 13 is ON)
1 (ON):
Rightmost
0 (OFF): Leftmost
Addition units
1 (ON):
Bytes
0 (OFF): Words
will not be added if bit 12 is ON.
1
MSB LSB
R
1
2
1
R
+1
3
4
1
R
+2
5
6
1
R
+3
7
8
1
Section
Operand Data Areas
C: Control data
IR, SR, AR, DM, HR, LR, #
R
: First word in range
1
IR, SR, AR, DM, HR, TC, LR
D: First destination word
IR, SR, AR, DM, HR, LR
to R
1
7-23
+N–1
1
to
1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents