Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
19 Applied Instructions (Data Operation 2)
19.1 WSUM / Sum of Word Data
498
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (WSUM/WSUMP)
The total value of n points of 16-bit data from the device specified by is stored in the device specified by
as 32-bit data.
2. 32-bit operation (DWSUM/DWSUMP)
The total value of n points of 32-bit data from the device specified by is stored in the device specified by
as 64-bit data.
Related instructions
Cautions
1) In 32-bit operation, the total value becomes 64-bit data. FX3U, FX3UC PLCs cannot handle 64-bit data.
However, when the total value is in the numeric value range of 32-bit data (K-2,147,483,648 to
K2,147,483,647), higher 32-bit data is ignored, and the lower 32-bit data can be handled as the total
value.
2) The instruction is provided in the FX
3UC PLC Ver. 2.20 or later.
Error
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in
D8067.
1) When n devices from the device specified by exceed the device range. (Error code: K6706)
2) When n 0. (Error code: K6706)
3) When the device specified by exceeds the range. (Error code: K6706)
Instruction Content
CCD
Check code
This instruction calculates the total value and the horizontal parity of 16-bit data in byte (8-bit) unit.
WSUM
EN
s
n
ENO
d
Command
input
Number of data
Head device for storing the total value
[ +1, ]
K13914
Total of n points
n points
(n=6)
K4444
K3333
K1234
K-5426
K326
K10000
+1
+0
+3
+2
+4
+5
s
d d
Head of device
Total of n points
n points
(n=5)
K32767000
K6000
K35392000
K-11870000
K12345000
K68640000
+1,
ss
DWSUM
EN
s
n
ENO
d
Command
input
Head of device
Number of data
Head device for storing the total value
d dd d
[]+3, +2, +1,
][
ss
+3, +2 ][
ss
+5, +4 ][
ss
+7, +6 ][
ss
+9, +8 ][