Mitsubishi Electronics FX3S ユーザーズマニュアル

ページ / 964
533
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
19 Data Operation 2 – FNC140 to FNC149
19.1 FNC140 – WSUM / Sum of Word Data
11
FN
C30
-FN
C3
9
R
ota
tion and 
Shi
ft
12
FN
C40-FN
C49
D
ata O
perati
on
13
FNC
50-FNC
59
High-Speed
 
Proc
essing
14
FM
C60-FN
C69
H
andy 
In
struction
15
FN
C70-FN
C79
E
xternal
 F
X
 I/O
 
De
vice
16
FNC
80-FNC
89
External
 FX 
Dev
ice
17
FNC1
00-
FNC10
9
Dat
Transfer 2
18
FNC1
10-
FNC139
Fl
oati
ng Poi
nt
19
FNC14
0-F
N
C
149
Da
ta
 
Operation 2
20
FNC1
50-
FNC159
Pos
itioning 
Control
Related instruction
Caution
• In the 32-bit operation, the acquired sum is 64-bit data. FX
3U
 and FX
3UC
 PLCs cannot handle 64-bit data. When the 
sum is within the numeric range of 32-bit data (K-2,147,483,648 to K2,147,483,647), however, FX
3U
 and FX
3UC
 
PLCs can handle the low-order 32 bits of 32-bit data as the sum while ignoring the high-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 
 are outside the specified device range (error code: K6706)
• When "n" is smaller than or equivalent to "0" (error code: K6706)
• When 
 are outside the specified device range. (error code: K6706)
Program example
In the program shown below, the sum of 16-bit data stored in D10 to D14 is stored in [D101, D100].
Instruction
Description
CCD (FNC 84)
Check code
Calculates the sum of 16-bit data in units of byte (8 bits) and the horizontal parity.
   
S
   
D
X010
FNC140
WSUMP
D10
D100
[D101,D100]
K5
WSUMP
instruction
K4500
K2500
K-3276
K6780
K4444
D10
K14948
END
D11
D12
D13
D14