EasyManuals Logo
Home>Mitsubishi>Controller>MELSEC-Q/L

Mitsubishi MELSEC-Q/L User Manual

Mitsubishi MELSEC-Q/L
850 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #359 background imageLoading...
Page #359 background image
357
SUM, SUMP, DSUM, DSUMP
1
2
3
4
4
6
7
8
7.5 Data processing instructions
7.5.2 SUM, SUMP, DSUM, DSUMP
Function
SUM
From the 16-bit data in the device designated by , stores the total number of bits where 1 is set, in the device
designated by .
DSUM
From the 32-bit data in the device designated by , stores the total number of bits where 1 is set, in the device
designated by .
Operation Error
(1) There is no operation error in the SUM(P) or DSUM(P) instruction.
Program Example
(1) The following program stores the number of bits which are ON from X8 to X17 into D0 when X10 is turned ON.
[Ladder Mode] [List Mode]
[Operation]
(2) The following program stores the number of bits which are ON in D100 and D101 into D0 when X10 is turned ON.
[Ladder Mode] [List Mode]
S
D
b15 b8
1
1 0 0 1 0 1 1 0 0 1 100 0 1
b0
b7
b15 b8
0
0 0 0 0 0 0 0 0 0 0 010 0 0
b0b7
Total number of bits where 1 is set
Stores the total number of bits where 1 is set in BIN.
(There are 8 bits where 1 is set in the example.)
S
D
S
D
S
D
1 0 0 1 1 1 0 0 1 0 1 001 1 1
b15 b8
0
0 0 0 0 0 0 0 0 0 0 100 0 0
b0b7
Total number of bits where 1 is set
Stores the total number of bits where 1 is set in BIN.
(There are 16 bits where 1 is set in the example.)
0 0 0 1 0 0 0 0 1 1 1 101 1 0
b31 b16b15 b0
S
+1
Step
Instruction
Device
X17
0
0 1 0 1 0 1 1 0 0 0 001 1 1
X8
Stores the total number of bits
where 1 is set at D0.
D0
7
Step
Instruction
Device

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Mitsubishi MELSEC-Q/L and is the answer not in the manual?

Mitsubishi MELSEC-Q/L Specifications

General IconGeneral
BrandMitsubishi
ModelMELSEC-Q/L
CategoryController
LanguageEnglish

Related product manuals