Chapter 4. Ladder Diagram (LD) Programming
194
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
4.10.4
Divide
When the DIV function receives power flow, it 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 power flow output is energized when DIV is performed, unless an invalid
operation or
occurs. (For more information, refer to the section on
Mnemonics:
DIV_DINT
DIV_INT
DIV_MIXED
DIV_REAL
DIV_LREAL
DIV_UINT
Notes:
▪
DIV rounds down; it does not round to the closest integer. For example,
24 DIV 5 = 4.
▪
DIV_MIXED uses mixed data types.
▪
Be careful to avoid overflows.
The following REAL and LREAL operations are invalid for DIV:
▪
Any number divided by 0. This operation yields a result of 65535.
▪
∞ divided by ∞
▪
I1 and/or I2 is NaN (Not a Number)
Mnemonic
Operation
Displays as
DIV_UINT
Q(16-bit) = IN1(16-bit) / IN2(16-bit) base 10 number, unsigned, up to 5 digits long
DIV_INT
Q(16-bit) = IN1(16-bit) / IN2(16-bit) base 10 number with sign, up to 5 digits long
DIV_DINT
Q(32-bit) = IN1(32-bit) / IN2(32-bit) base 10 number with sign, up to 10 digits long
DIV_MIXED
Q(16-bit) = IN1(32-bit) / IN2(16-bit) base 10 number with sign, up to 5 digits long
DIV_REAL
Q(32-bit) = IN1(32-bit) / IN2(32-bit) base 10 number, sign and decimals, up to 8 digits long
(excluding the decimals)
DIV_LREAL
Q(64-bit) = IN1(64-bit) / IN2(64-bit) base 10 number, sign and decimals, up to 17 digits long
(excluding the decimals)
Operands for the DIV Function
Parameter Description
Allowed Operands
Optional
IN1
Dividend: the value to be divided; shown to the left of
DIV
in
the equation IN1 DIV IN2=Q.
All except S, SA, SB, SC No
IN2
Divisor: the value to divide into IN1; shown to the right of
DIV
in the equation IN1 DIV IN2=Q.
All except S, SA, SB, SC No
Q
The quotient of IN1/IN2. If a DIV operation on signed operands
results in
, Q is set to the largest possible value and
there is no power flow.
If a DIV_UINT operation results in
, Q wraps around.
All except S, SA, SB, SC
and constant
No
Summary of Contents for PACSystems RX7i
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...