Mitsubishi Electric MELSEC FX3U Programming Manual page 558

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
2. 32-bit operation (DWSUM and DWSUMP)
The sum of "n" 32-bit data starting from [
+1,
D
D
Command
input
[
+1,
S
[
+3,
S
[
+5,
S
[
+7,
S
[
+9,
S
Related instruction
Instruction
CCD (FNC 84)
Caution
• In the 32-bit operation, the acquired sum is 64-bit data. FX
When the sum is within the numeric range of 32-bit data (K-2,147,483,648 to K2,147,483,647), however,
FX
and FX
3U
order 32 bits.
• Note that the 32-bit value [n+1, n] is valid when D or R is specified as "n" in a 32-bit instruction.
In the case of "DWSUM D0 D100 R0", "n" is [R1, R0].
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
• When "n" points starting from
• When "n" is smaller than or equivalent to "0" (error code: K6706)
• When
D
Program example
In the program shown below, the sum of 16-bit data stored in D10 to D14 is stored in [D101, D100].
X010
556
].
FNC140
S
D
DWSUM
K32767000
]
S
K6000
+2]
S
+4]
K35392000
S
K-11870000
+6]
(n = 5)
S
K12345000
+8]
S
Check code
Calculates the sum of 16-bit data in units of byte (8 bits) and the horizontal parity.
PLCs can handle the low-order 32 bits of 32-bit data as the sum while ignoring the high-
3UC
are outside the specified device range (error code: K6706)
S
are outside the specified device range. (error code: K6706)
FNC140
D10
D100
WSUMP
+1,
] is stored as 64-bit data in [
S
S
n
Sum of
"n"
"n" data
[
D
points
Description
and FX
3U
D10
K5
D11
D12
D13
END
D14
19 Data Operation 2 – FNC140 to FNC149
19.1 FNC140 – WSUM / Sum of Word Data
+3,
+2,
+1,
]
D
D
D
K68640000
PLCs cannot handle 64-bit data.
3UC
K4500
WSUMP
K2500
[D101,D100]
instruction
K-3276
K6780
K4444
+3,
+2,
D
D
K14948

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents