3.
Every time the input condition turns on, the value in the device specified in (s) is subtracted from the value in the device
specified in (d), and the result is stored in the device specified in (d).
(Input condition)
First: ON
Second: ON
Third: ON
4.
When the input condition turns on, the value in the device specified in (S2) is subtracted from the value in the device
specified in (S1), and the result is stored in the device specified in (d).
(Input condition)
ON
The following two instructions work on the same principle in the addition or subtraction processing.
X4
X5
X6
-P
(d)
D102
1000 (example)
990
980
(s1)
D102
-
970 (example) -
The value in D102 is not changed by the subtraction.
(Addition)
+P
(Subtraction)
-P
MOVP
K1000
D102
(s)
(d)
-P
K10
D102
(s1)
(s2)
(d)
D102
K50
D103
END
(s)
-
(10)
→ D102
-
10
→
-
10
→
-
10
→
The value in D102 changes.
(s2)
(50)
→ D103
50
→
K1 D100
INCP D100
K1
D102
DECP D102
71
3.
4.
(d)
990
980
970
(d)
920