Mitsubishi MELSEC iQ-F FX5 series Programming Manual page 168

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

-(P)(_U) [using three operands]
These instructions subtract the 16-bit binary data in the device specified by (s1) and the 16-bit binary data in the device
specified by (s2), and store the result in the device specified by (d).
Ladder diagram
(s1)
Setting data
■Descriptions, ranges, and data types
Operand
(s1)
-(P)
-(P)_U
(s2)
-(P)
-(P)_U
(d)
-(P)
-(P)_U
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(s1)
(s2)
(d)
Processing details
• These instructions subtract the 16-bit binary data in the device specified by (s1) and the 16-bit binary data in the device
specified by (s2), and store the subtraction result in the device specified by (d).
(s1)
b15
···
b0
5678 (BIN)
-
• When underflow or overflow occurs in the operation result, the following processing is executed. In this case, the carry flag
(SM700, SM8022) does not turn ON.
In case of -(P)
K-32768
-
K2
(8000H)
(0002H)
K32767
-
K-2
(7FFFH)
(FFFEH)
In case of -(P)(_U)
K0
-
K1
(0000H)
(0001H)
K0
-
K65535
(0000H)
(FFFFH)
Operation error
There is no operation error.
6 BASIC INSTRUCTIONS
166
6.2 Arithmetic Operation Instructions
(s2)
(d)
Description
Minuend data or the device where the data
from which another is to be subtracted is
stored
Subtrahend data or the device where the data
to be subtracted from another is stored
Device for storing the operation result
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
(s2)
b15
···
b0
b15
1234 (BIN)
K32766
(7FFEH)
K-32767
(8001H)
K65535
(FFFFH)
K1
(0001H)
Structured text
ENO:=MINUS(EN,s1,s2,d);
ENO:=MINUSP(EN,s1,s2,d);
Range
-32768 to +32767
0 to 65535
-32768 to +32767
0 to 65535
Double word Indirect
U\G
Z
LC
(d)
···
b0
4444 (BIN)
Because the highest bit is 0, the value is positive.
Because the highest bit is 1, the value is negative.
ENO:=MINUS_U(EN,s1,s2,d);
ENO:=MINUSP_U(EN,s1,s2,d);
Data type
16-bit signed binary
16-bit unsigned binary
16-bit signed binary
16-bit unsigned binary
16-bit signed binary
16-bit unsigned binary
Constant
specification
LZ
K, H
Data type (label)
ANY16_S
ANY16_U
ANY16_S
ANY16_U
ANY16_S
ANY16_U
Others
E
$

Advertisement

Table of Contents
loading

Table of Contents