Chapter 5. Function Block Diagram (FBD)
260 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C
5.9.3 Divide
Divides the operand IN1 by the operand IN2 of the same data type as IN1 and stores
the quotient in the output variable assigned to Q, also of the same data type as IN1
and IN2.
The result is output to Q when DIV is performed without Overflow, unless one of the
following invalid conditions occurs:
â–ª 0 divided by 0 (Results in an application fault.)
â–ª IN1 and/or IN2 is NaN (Not a Number).
If an Overflow occurs, the result wraps around.
Notes:
â–ª DIV rounds down; it does not round to the closest integer. For example, 24 DIV 5 = 4.
â–ª Be careful to avoid overflows.
Operands for DIV_UINT, DIV_INT, DIV_DINT, and DIV_REAL
Calculated by the FBD editor.
Dividend: the value to be divided; shown to
the left of DIV in the equation IN1 DIV IN2=Q.
INT, DINT, UINT,
REAL, LREAL
Divisor: the value to divide into IN1; shown to
the right of DIV in the equation IN1 DIV
IN2=Q.
INT, DINT, UINT,
REAL, LREAL
The quotient of IN1/IN2. If an Overflow
occurs, the result is the largest value with the
proper sign.
INT, DINT, UINT,
REAL or LREAL
variable
All except S, SA, SB,
SC and constant