Arithmetic Operation Instructions; Adding 16-Bit Binary Data - Mitsubishi MELSEC iQ-F FX5 series Programming Manual

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

Advertisement

6.2

Arithmetic Operation Instructions

Adding 16-bit binary data

+(P)(_U) instruction and ADD(P)(_U) instruction can be used for addition of 16-bit binary data.
+(P)(_U) [using two operands]
These instructions add 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)
(d)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
+(P)
Addend data or the device where the data that
is added to another is stored
+(P)_U
(d)
+(P)
Device where the data to which another is
added is stored
+(P)_U
■Applicable devices
Operand
Bit
X, Y, M, L,
U\G T, ST,
SM, F, B, SB
(s)
(d)
Processing details
• These instructions add the 16-bit binary data in the device specified by (s) to the 16-bit binary data in the device specified
by (d), and store the addition result in the device specified by (d).
(d)
···
b15
b0
b15
1234 (BIN)
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)
K32767
+
K2
(7FFFH)
(0002H)
K-32768
+
K-2
(8000H)
(FFFEH)
In case of +(P)(_U)
K65535
+
K2
(FFFFH)
(0002H)
Operation error
There is no operation error.
Word
T, ST, C, D,
C, LC
W, SD, SW, R
(s)
(d)
···
···
b0
b15
6912 (BIN)
K-32767
Because the highest bit is 1, the value is negative.
(8001H)
Because the highest bit is 0, the value is positive.
K32766
(7FFEH)
K1
(0001H)
Structured text
Not supported
Range
-32768 to +32767
0 to 65535
-32768 to +32767
0 to 65535
Double word Indirect
U\G
Z
LC
LZ
b0
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
Constant
specification
K, H
E
$
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
6
Others
161

Advertisement

Table of Contents
loading

Table of Contents