Addition; Subtraction - Mitsubishi Electric melsec-k Programming Manual

Hide thumbs Also See for melsec-k:
Table of Contents

Advertisement

4-4-5.
+
...
Addition
f
2
3
S
I)
to pulse)
( n l
( U 2 )
Fig. 4-34.
+
instruction
D
+
S is executed by
Mo ON, and the value
is stored in D.
The possible operation combination are
.shown in the following table by circles.
4-4-6.
-
...
Subtraction
0
, ,
.
to pulse)
( 1 1 1 )
(
D2
Fig. 4-35.
-
instruction
D
-
S (D2
-
Dl) is executed by MO ON, and
the value is stored in D (Le. D2).
(Coding)
0
L D
Mo
1
+
2
D1
3
r j
(The result is stored in D2.)
+
Kn Di
3
Kn
+
Dj
+
Dj
+
Di Dj
9
Dj
+
Di
*
Dj
If input remains ON, addition or subtraction is
executed at each scanning. Accordingly, input
is made after changing to pulse form.
(Coding)
0
'
L D
M,
1
-
2
D 1
$
3
D z
(The result of D2 - D1 is stored in D2.)
D becomes the minuend and
-
~
"
-
^
-
I
-
.
S becomes the sethtrahend,
.
so that caution is required, as
the positions are reversed from the
- I _ - _ c I _
normal calculation equations.
_
I
Example: Count-up number to the target position: 100
Deceleration start point: 15 counts in advance
Assuming D O
=
100
MOV D O Dl
-
Dl
=
100 is reached once,
-
K15,
D1
-
The result becomes D1
=
85.
In this way, both D O and D1 can be used next.
108
-
15
--c
85
-33-

Advertisement

Table of Contents
loading

Table of Contents