![IDEC OpenNet series User Manual Download Page 176](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384176.webp)
11: B
INARY
A
RITHMETIC
I
NSTRUCTIONS
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
11-11
SUM (Sum)
Valid Operands
For the valid operand number range, see page 6-2.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value is read out.
Since the SUM instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction
should be used as required.
Valid Data Types
When a word operand such as T (timer), C (counter), D (data register), or L (link register) is designated as the source or
destination, 1 point (word data type) is used.
Example: SUM
• ADD
• XOR
Operand
Function
I
Q
M
R
T
C
D
L
Constant
Repeat
S1 (Source 1)
First operand number for SUM
—
—
—
—
X
X
X
X
—
—
S2 (Source 2)
Last operand number for SUM
—
—
—
—
X
X
X
X
—
—
D1 (Destination 1)
Destination to store results
—
—
—
—
—
—
X
X
—
—
W (word)
I (integer)
D (double word)
L (long)
X
—
—
—
The SUM instruction can be selected for ADD or XOR operation.
ADD:
S1 through S2 added
→
D1·D1+1
XOR: S1 through S2 XORed
→
D1
When input is on with ADD selected, all data of operands designated
by S1 through S2 are added, and the result is stored to the destination
operand designated by D1 and the next operand D1+1.
When input is on with XOR selected, all data of operands designated
by S1 through S2 are XORed, and the result is stored to the destination
operand designated by D1.
SUM(W)
ADD/XOR
S1
*****
S2
*****
D1
*****
I0
SUM(W)
ADD
S1
D10
D1
D20
S2
D12
SOTU
When input is on, all data of D10 through D12 are added, and
the result is stored to D20 and D21.
100
D10
+
200
D11
600
D20·D21
+
300
D12
I0
SUM(W)
XOR
S1
D10
D1
D20
S2
D12
SOTU
When input is on, all data of D10 through D12 are XORed,
and the result is stored to D20.
1
D10
+
2
D11
+
3
D12
0
D20
1h = 0000 0000 0000 0001
2h = 0000 0000 0000 0010
3h = 0000 0000 0000 0011
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]