Mitsubishi MELSEC iQ-F FX5 series Programming Manual page 165

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

Advertisement

ADD(P)(_U)
These instructions add 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)
(s2)
(d)
*1 The ADD instruction is not supported by the ST language. Use ADD of the standard function.
Page 777 ADD(_E)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s1)
ADD(P)
Addend data or the device where the data that
is added to another is stored
ADD(P)_U
(s2)
ADD(P)
Addend data or the device where the data that
is added to another is stored
ADD(P)_U
(d)
ADD(P)
Device for storing the operation result
ADD(P)_U
■Applicable devices
Operand
Bit
X, Y, M, L,
U\G T, ST,
SM, F, B, SB
(s1)
(s2)
(d)
Processing details
• These instructions add 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 addition result in the device specified by (d).
(s1)
b15
···
b0
b15
5678 (BIN)
+
1234 (BIN)
■Relationship between the flag operation and the sign (positive or negative) of a numeric value
Device
Name
SM700, SM8022
Carry
SM8020
Zero
SM8021
Borrow
Zero Flag
-2, -1, 0,
-32768
Borrow flag
The most significant
bit of data becomes "1".
Word
T, ST, C, D,
C, LC
W, SD, SW, R
(s2)
(d)
···
b0
b15
···
6912 (BIN)
Description
When the operation result exceeds the upper limit of the data setting range, the carry flag is turned ON.
When the operation result is 0, the zero flag is turned ON.
When the operation result is less than the lower limit of the data setting range, the borrow flag is turned ON.
Zero Flag
-1, 0, 1
The most significant
bit of data becomes "0".
*1
Structured text
ENO:=ADDP(EN,s1,s2,d);
Range
-32768 to +32767
0 to 65535
-32768 to +32767
0 to 65535
Double word Indirect
U\G
Z
LC
LZ
b0
Zero Flag
32767,
0, 1, 2
Carry flag
ENO:=ADD_U(EN,s1,s2,d);
ENO:=ADDP_U(EN,s1,s2,d);
Data type
Data type (label)
16-bit signed binary
ANY16_S
16-bit unsigned binary
ANY16_U
16-bit signed binary
ANY16_S
16-bit unsigned binary
ANY16_U
16-bit signed binary
ANY16_S
16-bit unsigned binary
ANY16_U
Constant
specification
K, H
E
$
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
6
Others
163

Advertisement

Table of Contents
loading

Table of Contents