7 Applied Instructions
7.5 Data Operation
247
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied
Instructions
8
Interrupt Function
and Pulse Catch
Function
A
Relationships
between devices
and addresses
Function and operation explanation
1. 16-bit operation (SUM ,SUMP)
The number of bits in the ON status in the device specified by is counted, and stored to the device
specified by .
• When all bits are 0 (OFF) in the device specified by , the zero flag M8020 turns ON.
2. 32-bit operation (DSUM, DSUMP)
The number of bits in the ON status in the device specified by is counted, and stored to the device
specified by .
• The number of bits in the ON status is stored in the device specified by , and K0 is stored in +1.
• When all bits are 0 (OFF) in the device specified by , the zero flag M8020 turns ON.
Number of bits in the ON status in
ds
Before
execution
After
execution
K21847
K0
K21847
K9
Word data
16-bit data
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0000000000000000
b0b1b2b3b4b5b6b7b8b9
b10b11b12b13b14b15
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
b0b1b2b3b4b5b6b7b8b9
b10b11b12b13b14b15
1001000000000000
123←4←5←6←7←8←9 (Number of "1" (ON))
32 16 8 4 2 1
Command input
SUM data
Resulting data
SUM
EN
s
ENO
d
d
s
s
d
←
Command input
Label1
*1
Label2
*2
*1 This defines the data that executes SUM_2 or the device number storing the source data.
*2 This defines the device that stores the result of executing SUM_2.
DSUM
EN
s
ENO
d
+1,
K0 is written.
ds
s
d
K21847
K0
K21847
K9
K0
K0
Word data
32-bit data
b16b17b31 ···
b0b1b2b3b4b5b6b7b8b9
b10b11b12b13b14b15
b16b17b31 ···
b0b1b2b3b4b5b6b7b8b9
b10b11b12b13b14b15
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))
1001000000000000 1001000000000000
0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
s
d
d
s
Number of bits in the ON status in [ +1, ]
Before
execution
After
execution
←