4 subtraction instruction (sub) – Yaskawa MP900 Series Machine Controller New Ladder Editor User Manual
Page 34

1 Ladder Program Instructions
1.2.4 SUBTRACTION Instruction (SUB)
1-24
Program Example
This instruction is used in cases where it is desirable that operation errors do not occur in the
addition of integer type values.
In the case of double-length integer type values, an operation using addition and subtraction instruc-
tions (+,
−, ++, --) will be a 32-bit operation. However, when an addition or subtraction instruction is
used in a remainder correction operation (where a multiplication instruction (
×) is the immediately pre-
ceding instruction and a division instruction
(÷) is the immediately subsequent instruction), the opera-
tion will be a 64-bit operation.
1.2.4 SUBTRACTION Instruction (SUB)
Outline
The SUB instruction subtracts integer, double-length integer, and real number values. Source
B is subtracted to Source A and stored in the Dest. If the result of subtracting integer values
is smaller than -32768, an underflow error occurs. If the result of subtracting double-length
integer values is smaller than -2147483648, an underflow error occurs.
Format
INFO
Symbol: SUB
Full Name: Subtract
Category: MATH
Icon: