Mitsubishi Electronics Mitsubishi Digital Electronics Video Gaming Accessories FX3G ユーザーズマニュアル

ページ / 936
323
FX
3G
/FX
3U
/FX
3UC
 Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
12 Data Operation – FNC 40 to FNC 49
12.4 FNC 43 – SUM / Sum of Active Bits
11
FN
C
30
-FN
C
39
R
otati
on and 
Shi
ft
12
FNC4
0-F
NC4
9
D
ata O
per
ati
on
13
FN
C
50-FN
C
59
H
igh S
pe
ed 
P
rocessing
14
FM
C
60-FN
C
69
H
andy 
In
st
ru
ct
ion
15
FNC7
0-F
NC7
9
Ex
ter
nal FX
 I/O
 
D
evice
16
FN
C
80-FN
C
89
Ext
ernal
 FX 
De
vic
e
17
FN
C
100-
FN
C
10
9
Da
ta
 
Transf
er 2
18
FN
C
110-
FN
C
139
Floati
ng Poi
nt
19
FN
C
14
0-F
N
C
149
Da
ta
 
O
per
at
ion 2
20
FN
C
150-
FN
C
159
Posit
ioning 
C
ont
ro
l
2. 32-bit operation (DSUM and DSUMP)
The number of bits in the ON status in [
+1, 
] is counted, and stored to 
.
• The number of bits in the ON status are stored in 
, and K0 is stored in 
+1.
• When all bits are OFF in [
+1, 
], the zero flag M8020 turns ON.
3. Operation result 
 according to the 
 value (in 16-bit operation)
M8020 
(zero
flag)
Bit device
Word device
b15
b14
b13
b12
b11
b10
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
Decimal
Hexadecimal
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0000
0
ON
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0001
1
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
2
0002
1
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
3
0003
2
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
4
0004
1
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
5
0005
2
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
6
0006
2
OFF
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
7
0007
3
OFF
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
8
0008
1
OFF
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
9
0009
2
OFF
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
10
000A
2
OFF
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
11
000B
3
OFF
OFF
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
−5
FFFB
15
OFF
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
−4
FFFC
14
OFF
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
−3
FFFD
15
OFF
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
−2
FFFE
15
OFF
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
−1
FFFF
16
OFF
  
D
1
   
S
  
D
1
   
S
  
D
1
   
D
  
D
1
   
D
  
D
1
   
D
  
D
1
   
S
  
D
1
   
S
[          +1,          ]
S ‚
S ‚
Command
input
FNC 43
DSUM
S ‚
D ‚
Before
execution
After
execution
S ‚
D ‚
K21847
K0
K21847
K9
K0
K0
S ‚
D ‚
D ‚
Number of bits in
the ON status in
D ‚ +1,
Word data
32-bit data
K0 is written
0 0 0 0 0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
b16
b17
b31
b0
b1
b2
b3
b4
b5
b6
b7
b8
b9
b10
b11
b12
b13
b14
b15
b16
b17
b31
b0
b1
b2
b3
b4
b5
b6
b7
b8
b9
b10
b11
b12
b13
b14
b15
32 16 8 4 2 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 0 0 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
2
3
4
5
6
7
8
9
(Number of "1" (ON))
  
D
1
   
D
  
D
1
   
S
  S
  D