Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 287

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Processing details
• These instructions subtract the (n) points of 16-bit binary data from the device specified by (s2) or the constant from the (n)
points of 16-bit binary data from the device specified by (s1), and store the operation result in the device specified by (d)
and later.
• Specify data in units of 16 bits.
Ex.
When a device is specified by (s2)
b15
∙∙∙
b0
(s1)
8765
(BIN)
(s1)+1
8888
(BIN)
(s1)+2
9325
(BIN)
(n)
(s1)+(n)-2
5000
(BIN)
(s1)+(n)-1
4352
(BIN)
When a constant is specified by (s2)
b15
∙∙∙
b0
(s1)
8765
(BIN)
(s1)+1
8888
(BIN)
(s1)+2
9325
(BIN)
(n)
(s1)+(n)-2
5000
(BIN)
(s1)+(n)-1
4352
(BIN)
• If an overflow occurs, the result will be as follows. In this case, SM700 does not turn on.
When a signed value is specified
K-32767
K2
-
(H8001)
(H0002)
K32767
K-2
-
(H7FFF)
(HFFFE)
Operation error
Error code
Description
(SD0)
2821H
The device ranges starting from the ones specified by (s1) and (d) are overlapping (except when the same device is specified for (s1) and
(d)).
The device ranges starting from the ones specified by (s2) and (d) are overlapping (except when the same device is specified for (s2) and
(d)).
b15
∙∙∙
b0
(s2)
1234
(BIN)
(s2)+1
5678
(BIN)
(s2)+2
9876
(BIN)
(n)
-
(s2)+(n)-2
4321
(BIN)
(s2)+(n)-1
4000
(BIN)
b15
∙∙∙
b0
(s2)
8880
(BIN)
-
K32766
(H7FFE)
K-32767
(H8001)
b15
∙∙∙
b0
(d)
7531
(BIN)
(d)+1
3210
(BIN)
(d)+2
-551
(BIN)
(d)+(n)-2
679
(BIN)
(d)+(n)-1
352
(BIN)
b15
∙∙∙
b0
(d)
-115
(BIN)
(d)+1
8
(BIN)
(d)+2
445
(BIN)
(d)+(n)-2
-3880
(BIN)
(d)+(n)-1
-4528
(BIN)
When an unsigned value is specified
K0
K1
-
(H0000)
(H0001)
6.2 Arithmetic Operation Instructions
(n)
(n)
K65535
(HFFFF)
6 BASIC INSTRUCTIONS
6
285

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents