Download Print this page

Subtracting 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Subtracting 16-bit binary data

-(P)(_U) instruction and SUB(P)(_U) instruction can be used for subtraction of 16-bit binary data.
-(P)(_U) [using two operands]
These instructions subtract the 16-bit binary data in the device specified by (d) and the 16-bit binary data in the device
specified by (s), and store the result in the device specified by (d).
Ladder diagram
(s)
FBD/LD
Not supported.
Setting data
■Descriptions, ranges, and data types
Operand
(s)
-(P)
-(P)_U
(d)
-(P)
-(P)_U
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
Processing details
• These instructions subtract the 16-bit binary data in the device specified by (d) and the 16-bit binary data in the device
specified by (s), and store the subtraction result in the device specified by (d).
(d)
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)
(d)
b15
b0
···
32768
(BIN)
-
(d)
b15
b0
···
32767
(BIN)
-
In case of -(P)(_U)
(d)
b15
b0
···
0
(BIN)
-
(d)
b15
b0
···
0
(BIN)
-
7 BASIC INSTRUCTIONS
188
7.2 Arithmetic Operation Instructions
(d)
Description
Subtrahend data or the device where the data
to be subtracted from another is stored
Device where the data from which another is to
be subtracted is stored
Word
T, ST, C, D, W,
SD, SW, R
(s)
b15
b0
b15
···
1234 (BIN)
(s)
b15
b0
b15
···
2
(BIN)
(s)
b15
b0
b15
···
-2
(BIN)
(s)
b15
b0
b15
···
1
(BIN)
(s)
b15
b0
b15
···
65535
(BIN)
Structured text
Not supported
Range
-32768 to +32767
0 to 65535
-32768 to +32767
0 to 65535
Double word Indirect
U\G
Z
LC
(d)
b0
···
4444 (BIN)
(d)
b0
···
32766
(BIN)
(d)
b0
···
-32767
(BIN)
(d)
b0
···
65535
(BIN)
(d)
b0
···
1
(BIN)
Data type
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
Others
E
$

Hide quick links:

Advertisement

loading