Download Print this page

Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 194

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

Advertisement

SUB(P)(_U)
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)
*1
FBD/LD
EN
ENO
s1
d
s2
("SUBP", "SUB_U", "SUBP_U" enters .)
*1 The SUB instruction is not supported by the ST language and the FBD/LD language. Use SUB of the standard function.
Page 991 SUB(_E)
Setting data
■Descriptions, ranges, and data types
Operand
(s1)
SUB(P)
SUB(P)_U
(s2)
SUB(P)
SUB(P)_U
(d)
SUB(P)
SUB(P)_U
EN
ENO
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(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)
-
7 BASIC INSTRUCTIONS
192
7.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
Execution condition
Execution result
Word
T, ST, C, D, W,
SD, SW, R
(s2)
b15
b0
b15
···
1234 (BIN)
Structured text
ENO:=SUBP(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)
*1
ENO:=SUB_U(EN,s1,s2,d);
ENO:=SUBP_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
Bit
Bit
Constant
specification
LZ
K, H
Data type (label)
ANY16_S
ANY16_U
ANY16_S
ANY16_U
ANY16_S
ANY16_U
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading