High−level Instructions
3 − 298
Outline Counts the number of bits in the on (1) state in the specified 16-bit data.
For the FP0R/FPΣ/FP−X/FP0/FP−e, the P type high−level instruction
“P135 (PBCU)” is not available.
Program example
Boolean
Ladder Diagram
Address Instruction
10 F135 BCU , DT10 , DT 20
S
D
Trigger
R0
10
11
ST R 0
F135 (BCU)
DT 10
DT 20
S 16-bit equivalent constant or 16-bit area (source)
D 16-bit area (destination) for storing the number of bits in the on (1) state
Operands
modifier
S A A A A A A A A A A A A A A
D N/A A A A A A A A A A A N/A N/A A
(*1) This cannot be used with the FP0 and FP−e.
(*2) This cannot be used with the FP0, FP−e, FP0R, FPΣ, FP−X.
(*3) With the FP0R, FPΣ,FP−X, FP2, FP2SH, and FP10SH, this is I0 to IC.
(*4) With the FP0R, FPΣ,FP−X, FP2, FP2SH, and FP10SH, this is ID.
Explanation of example
Counts the number of bits in the on (1) state in data register DT10 when trigger R0 turns on. The number of on
(1) bits is stored in data register DT20.
····
Bit position
·····
Binary data
15
000
12
0
11
000
8
1
7
001
4
1
3
010
0
1
DT10
The number of on (1) bits is “5”.
The K5 is stored in data register DT20 when R0 turns on.
F135
P135
(PBCU)
(BCU)
Number of on (1) bits in 16-bit data
A: Available
N/A: Not Available