6 - 43 6 - 43
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
E
-
(1) Subtracts the floating decimal point type real number designated by
S1
from the floating
decimal point type real number designated by
S2
, and stores the result at the device
designated by
D
.
+1
Floating decimal point
t
e real number
+1
+1
S1 S2
D
S1 S2
D
Floating decimal point
t
e real number
Floating decimal point
t
e real number
-
(2) Values that can be designated by
S1
,
S2
or
D
and values that can be stored, are as follows:
0, ±2
-126
| Designated value (stored value) | < ±2
128
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• The contents of the designated device or the result of the addition or subtraction operation
are not "0", or not within the following range: (Error code: 4100)
0, ±2
-126
| Contents of designated device/ result of operation | < ±2
128
• When the specified device contains -0 (Q4ARCPU)
(Operation error does not occur even if -0 is stored if SM707 is turned on.) (Error code: 4100)
[Program Example]
(1) The following program adds the floating decimal point type real numbers at D3 and D4 and the
floating decimal point type real numbers at D10 and D11 when X20 goes ON, and outputs the
result to R0 and R1.
[Ladder Mode] [List Mode]
END5
0
X20
P
E+ D3 D10 R0
LD
E+P
END
Steps Instruction
Device
0
1
5
X20
D3
D10
R0
+
D4
5961.437
D3
D11
12003.2
D10
D4
17964.64
D3
(2) The following programs subtracts the floating decimal point type real numbers at D20 and D21
from the floating decimal point type real numbers at D11 and D10, and stores the result at D30
and D31.
[Ladder Mode] [List Mode]
END5
0
SM400
P
E- D10 D20 D30
LD
E-P
END
Steps Instruction
Device
0
1
5
SM400
D10
D20
D30
D11
97365.2
D10
D21
76059.8
D20
D21
21305.41
D20
-
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com