Sum - Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual

Table of Contents

Advertisement

SUM

Instruction
SUM
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
OK
Operands
Operand
C
First control word
R1
First word in range
D
First destination word
C: First control word
15
C
15
14
13 12 11
C+1
0000 0000 0000
Starting byte (Effective if bit 13 is 1.)
0: Leftmost byte
1: Rightmost byte
Units
0: Words
1: Bytes
Data type
0: Binary
1: BCD
Data type (Effective if bit 14 is 0.)
0: Unsigned binary data
1: Signed binary data
Operand Specifications
Word addresses
Area
CIO
WR
HR
C
R1
OK
OK
OK
D
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Mnemonic
Variations
SUM
@SUM
Block program areas
Step program areas
OK
OK
Description
0
W: Number of words/bytes in range
&1 to &65535 (decimal) or
#0001 to #FFFF (hex)
0
0
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Function
code
Adds the bytes or words in the range and outputs
184
the result to two words.
SUM
SUM(184)
C: First control word
C
R1: First word in range
R1
D
D: First destination word
Subroutines
OK
Data type
UDINT
UINT
UDINT
R1: First word in range
15
R1
to
R1+(W–1)
D: First destination word
15
D+1
The leftmost four digits are stored in D+1 and the rightmost
four digits are stored in D.
Note C and C+1, all of the words in the calculation range must
be in the same data area.
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
OK
OK
OK
---
---
3. Instructions
Function
SFC action or
Interrupt tasks
transition programs
OK
OK
Size
2
Variable
2
0
Calculation range
---
0
15
D
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
3
0
TR
bits
---
---
603

Advertisement

Table of Contents
loading

Table of Contents