![Mitsubishi Electric FX5U Series Скачать руководство пользователя страница 72](http://html.mh-extra.com/html/mitsubishi-electric/fx5u-series/fx5u-series_training-manual_1811871072.webp)
[*(P)] (Multiplication of 16-bit binary data)
[/(P)] (Division of 16-bit binary data)
1.
When the input condition turns on, the value in the device specified in (s1) is multiplied by the value in the device
specified in (s2), and the result is stored in the device specified in (d).
X0
D100
D20
MOVP
X2
X3
D120
K600
D100
/P
D110
D100
K600
*P
1.
2.
END
(s1)
(d)
(s2)
(s1)
(d)
(s2)
K600
600
×
D100
4000
=
D111
2400000
Since these device areas are used as a
32-bit (2-word) register for storing the result,
the left-most bit of D110 (b15) is regarded
as a part of the data, not as a sign bit.
When programming a ladder using the operation result of the *(P) instruction, always use 32-bit
instructions (such as the DMOV instruction and the DMOVP instruction).
To store the result of 16-bit data × 16-bit data,
a space of 16 bits (1 word) is not enough.
Thus, the D110 specified in the program and
the subsequent device area D111 are used
for storing the result.
D110
(s1)
(d)
(s2)
2.
When the input condition turns on, the value in the device specified in (s1) is divided by the value in the device specified
in (s2), and the result is stored in the device specified in (d). Values after the decimal point of the division result are
ignored.
When a bit device is specified in (d), the quotient is stored but the remainder is not stored.
The following shows examples of processing of negative values.
The following shows examples of dividing a value by 0 or dividing 0 by a value.
D100
4000
÷
K600
600
=
D120
6
400
and
Quotient
D121
The remainder is stored in the
subsequent device area D121.
The quotient is stored in D120 that
is specified in the program.
Remainder
(s1)
(d)
(s2)
Example
-5 ÷ (-3) = 1, remainder = -2
5 ÷ (-3) = -1, remainder = 2
0 ÷ 0
1 ÷ 0
0 ÷ 1
Error "OPERATION ERROR"
Quotient and remainder = 0
Example
72
Содержание FX5U Series
Страница 1: ...FX5U Training Manual ...