Chapter 5. Function Block Diagram (FBD)
264 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C
5.9.7 Subtract
Subtracts the operands IN2 …IN8 from the operand IN1
and stores the result in the output variable assigned to
Q.
The calculation is carried out when SUB is performed
without Overflow, unless an invalid operation occurs.
If a SUB operation results in Overflow, the result wraps
around. For example:
▪ If a SUB_DINT, SUB_INT or SUB_REAL operation is
performed on 32768 - 1, Q will be set to -32767.
If a SUB_UINT operation results in a negative number,
Q wraps around. (For example, a result of –1 sets Q to
65535.)
Minimum number of
inputs = 2
Maximum number of
inputs = 8.
Q(16-bit) = IN1(16-bit) –
IN2(16-bit)
base 10 number with sign, up to 5 digits long
Q(32-bit) = IN1(32-bit) –
IN2(32-bit)
base 10 number with sign, up to 10 digits long
Q(32-bit) = IN1(32-bit) –
IN2(32-bit)
base 10 number, sign and decimals, up to 8 digits long (excluding
the decimals)
Q(16-bit) = IN1(16-bit) –
IN2(16-bit)
base 10 number, unsigned, up to 5 digits long
Calculated by the FBD editor.
The value to subtract from.
The value(s) to subtract from IN1. Must be
the same data type as IN1.
The result of the subtraction. Must be the
same data type as IN1.
DINT, INT, REAL,
UINT variable
All except S, SA, SB, SC
and constant