Mitsubishi Electric MELSEC-Q/L Programming Manual page 262

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

Advertisement

• The following will happen if an overflow occurs in an operation result: The carry flag (SM700) in this case does not go ON.
+K2
K2147483647
(00000002
(7FFFFFFF
)
H
K 2147483647
+K
( FFFFFFFE
(80000001
)
H
■DBK-
• This instruction subtracts BIN 32-bit data stored in the n-point devices starting from the device specified by (S2) or a
constant from BIN 32-bit data stored in n-point devices starting from the device specified by (S1), and then stores the
operation result into the nth device specified by (D) and up.
When a device is specified for (S2)
b31
S1 +1,
S1
S1 +3,
S1 +2
S1 +5,
S1 +4
S1 +(2n-1),
S1 +(2n-2)
When a constant is specified for (S2)
b31
S1 +1,
S1
S1 +3,
S1 +2
S1 +5,
S1 +4
S1 +(2n-1),
S1 +(2n-2)
• Block subtraction is performed in 32-bit units.
• The constant in the device specified by (S2) can be between -2147483648 to 2147483647 (BIN 32-bit data).
• If the value specified by n is 0, the instruction will be not processed.
• Specify (D) out of the range of n-point devices starting from the device specified by (S1) and (S2). However, (S1) and (S2)
can specify the same device.
• The following will happen if an overflow occurs in an operation result: The carry flag (SM700) in this case does not go ON.
K 2
K2147483647
(00000002
(7FFFFFFF
)
H
K 2147483647
( FFFFFFFE
(80000001
)
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
4100
A negative value is specified for n.
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)).
6 BASIC INSTRUCTIONS
260
6.2 Arithmetic Operation Instructions
K 2147483647
) ( 80000001
H
H
K2147483647
2
) ( 7FFFFFFF
H
b0
-55555
(BIN)
S2 +1,
33333
(BIN)
S2 +3,
n
44444
(BIN)
-
S2 +5,
13579
(BIN)
S2 +(2n-1),
b0
-99999
(BIN)
99999
(BIN)
n
-
-59999
(BIN)
S2 +1,
79999
(BIN)
) ( 80000001
)
H
H
K2147483647
K2
) ( 7FFFFFFF
H
)
)
H
b31
44445
(BIN)
S2
3333
(BIN)
S2 +2
-10000
(BIN)
S2 +4
12345
(BIN)
S2 +(2n-2)
b31
b0
9999
(BIN)
S2
)
H
Q00J/
Q00/
Q01
b0
D +1,
D
D +3,
D +2
n
D +5,
D +4
D +(2n-1),
D +(2n-2)
b31
-109998
D +1,
D
90000
D +3,
D +2
69998
D +5,
D +4
70000
D +(2n-1),
D +(2n-2)
QnH
QnPH
QnPRH
b31
b0
-1000000
(BIN)
30000
(BIN)
n
54444
(BIN)
1234
(BIN)
b0
(BIN)
(BIN)
n
(BIN)
(BIN)
QnU
LCPU

Advertisement

Table of Contents
loading

Table of Contents