Mitsubishi MELSEC QCPU Programming Manual page 194

Programmable logic controller
Table of Contents

Advertisement

6 BASIC INSTRUCTIONS
E -
(1) Subtracts the floating decimal point type real number designated by
decimal point type real number designated by
designated by
Floating decimal point
(2) Values that can be designated by
-126
0, ±2
[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)
-126
0, ±2
• 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]
X20
0
5
(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]
SM400
0
5
6 - 43
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
.
D
+1
S1
S1
S2
-
Floating decimal point
type real number
type real number
S1
| Designated value (stored value) | < ±2
| Contents of designated device/ result of operation | < ±2
P
E+
D3
D10
R0
END
D4
D3
D11
5961.437
+
P
E-
D10
D20
D30
END
D11
D10
D21
-
97365.2
, and stores the result at the device
S2
+1
+1
D
S2
Floating decimal point
type real number
,
or
and values that can be stored, are as follows:
D
S2
128
[List Mode]
Steps
Instruction
0
LD
1
E+P
5
END
D10
D4
12003.2
17964.64
[List Mode]
Steps
Instruction
0
LD
1
E-P
5
END
D20
D21
76059.8
21305.41
MELSEC-Q/QnA
from the floating
S1
D
128
Device
X20
D3
D10
R0
D3
Device
SM400
D10
D20
D30
D20
6 - 43

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec qnacpuMelsec q modeMelsec q series

Table of Contents