Mitsubishi Electric MELSEC-Q/L Programming Manual page 259

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

■BK-
• Subtracts n points of BIN data from the device designated by (S1) and n-points of BIN data from the device designated by
(S2) and stores the result to the area starting from the device designated by (D).
b15
b0
8765
(BIN)
S1
8888
(BIN)
+1
S1
9325
(BIN)
+2
S1
n
5000
(BIN)
S1
+(n 2)
4352
(BIN)
S1
+(n 1)
• Block subtraction is performed in 16-bit units.
• The constant designated by (S2) can be between -32768 and 32767 (BIN 16-bit data).
b15
b0
8765
(BIN)
S1
8888
(BIN)
+1
S1
9325
(BIN)
+2
S1
n
5000
(BIN)
S1
+(n 2)
4352
(BIN)
S1
+(n 1)
• The following will happen when an underflow or overflow is generated in an operation result: The carry flag (SM700) in this
case does not turn ON.
K 32768
K2
K32766
(8000
)
(0002
)
(7FFE
H
H
K32767
K 2
(7FFF
)
(FFFE
)
(8001
H
H
Operation error
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
Error details
code
4101
The points specified in n exceed those of the corresponding device specified
in (S1), (S2), or (D).
The ranges of devices starting from the one specified in (S1) and (D) overlap
by n points. (except when the same device is specified in (S1) and (D)).
The ranges of devices starting from the one specified in (S2) and (D) overlap
by n points. (except when the same device is specified in (S2) and (D)).
b15
b0
1234
(BIN)
S2
5678
(BIN)
+1
S2
9876
(BIN)
+2
S2
4321
(BIN)
S2
+(n 2)
4000
(BIN)
S2
+(n 1)
b15
b0
8880
(BIN)
S2
)
H
32767
)
H
b15
7531
(BIN)
D
3210
(BIN)
D
+1
551
(BIN)
D
+2
n
679
(BIN)
D
+(n 2)
352
(BIN)
D
+(n 1)
b15
115
(BIN)
D
8
(BIN)
D
+1
445
(BIN)
D
+2
3880
(BIN)
D
+(n 2)
4528
(BIN)
D
+(n 1)
Q00J/
QnH
Q00/
Q01
6.2 Arithmetic Operation Instructions
b0
n
b0
n
QnPH
QnPRH
QnU
LCPU
6 BASIC INSTRUCTIONS
6
257

Advertisement

Table of Contents
loading

Table of Contents