DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-120
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Bit Operation Instructions
Sum (SUM)
The Sum instruction counts number of bits that are set to “1” in
the accumulator. The HEX result resides in the accumulator.
In the following example, when X1 is on, the value formed by discrete locations X10–X17 is
loaded into the accumulator using the Load Formatted instruction. The number of bits in the
accumulator set to “1” is counted using the Sum instruction. The value in the accumulator is
copied to V1500 using the Out instruction.
NOTE: Status flags are valid only until another instruction uses the same flag.
SUM
Direct SOFT32 Display
LDF X10
K8
X1
Load the value represented by
discrete locations X10–X17
into the accumulator
SUM
Sum the number of bits in
the accumulator set to “1”
OUT
V1500
Copy the value in the lower
16 bits of the accumulator
to V1500
X10X11X12X13
ONONOFFON
X14X15X16X17
OFFOFFONON
00000000110010
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 1631 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
V1500
Acc.
000 5
000 0 000 5
The unused accumulator
bits are set to zero
STR
$
ENT
SHFT
ANDST
L
3
D
5
F
SHFT
RST
S
ISG
U
ORST
M
ENT
1
B
1
B
0
A
8
I
ENT
SHFT
OUT
GX
PREV
1
B
5
F
0
A
0
A
ENTPREV PREV
Handheld Programmer Keystrokes
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
DS Used
HPP Used
DirectSOFT