448
7 APPLICATION INSTRUCTIONS
7.5 Data Processing Instructions
Calculation of totals for 16-bit data
WSUM(P)
• Adds all 16-bit BIN data for n blocks from the device designated at (S), and stores it in the device designated at (D).
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
• The following program adds the 16-bit BIN data from D10 to D14, and stores it in D100 and D101 when X1C is turned ON.
(S): Head number of the devices where data to be summed are stored (BIN 16 bits)
(D): Head number of the devices where the sum will be stored (BIN 32 bits)
n: Number of data blocks (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
K, H
Others
Bit Word Bit Word
(S)
(D)
n
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4101 The points specified in n exceed those of the corresponding device specified
in (S).
[Ladder Mode] [List Mode]
[Operation]
Basic
Process
High
performance
Redundant
Universal
LCPU
n
n
WSUM
WSUMP
D
D
Command
Command
WSUMP
WSUM
S
S
4444 (BIN)
+ 1
+ 2
3333 (BIN)
1234 (BIN)
5426 (BIN)
329 (BIN)
+ 3
+ 4
13914 (BIN)
10000 (BIN)
+ 5
S
S
D
S
S
S
n
D
S
+ 1
,
Step
Instruction
Device
4500 (BIN)
D10
2500 (BIN)
3276 (BIN)
6780 (BIN)
14948 (BIN)
D11
D12
D13
D101,D100
4444 (BIN)
D14