Mitsubishi Electronics FX3G Video Gaming Accessories User Manual


 
323
FX3G/FX3U/FX3UC 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
FNC30-FNC39
Rotation and
Shift
12
FNC40-FNC49
Data Operation
13
FNC50-FNC59
High Speed
Processing
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
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
0000000000000000 0 0000 0 ON
0000000000000001 1 0001 1 OFF
0000000000000010 2 0002 1 OFF
0000000000000011 3 0003 2 OFF
0000000000000100 4 0004 1 OFF
0000000000000101 5 0005 2 OFF
0000000000000110 6 0006 2 OFF
0000000000000111 7 0007 3 OFF
0000000000001000 8 0008 1 OFF
0000000000001001 9 0009 2 OFF
0000000000001010 10 000A 2 OFF
0000000000001011 11 000B 3 OFF
OFF
1111111111111011 5 FFFB 15 OFF
1111111111111100 4 FFFC 14 OFF
1111111111111101 3 FFFD 15 OFF
1111111111111110 2 FFFE 15 OFF
1111111111111111 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
1001000000000000
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
1001000000000000
b16b17b31
b0b1b2b3b4b5b6b7b8b9b10b11b12b13b14b15
b16b17b31
b0b1b2b3b4b5b6b7b8b9b10b11b12b13b14b15
32 16 8 4 2 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 10 0 0 0 0
0000000000000000
00000
123
4
5
6
7
8
9(Number of "1" (ON))
D
1
D
D
1
S
S
D