
Chapter 5. Function Block Diagram (FBD)
GFK-2950C
February 2018
261
5.9.4
Modulus
Divides input IN1 by input IN2 and outputs the remainder of the division to Q.
All three operands must be of the same data type. The sign of the result is always
the same as the sign of input parameter IN1. Output Q is calculated using the
formula:
Q = IN1-((IN1 DIV IN2) * IN2)
where DIV produces an integer number.
The result is output to Q 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)
Operands for Modulus Function
Parameter Description
Allowed Types Allowed Operands
Optional
Solve Order Calculated by the FBD editor.
NA
NA
No
IN1
Dividend: the value to be divided into in
order to obtain the remainder; shown to the
left of
MOD
in the equation IN1 MOD IN2=Q.
INT, DINT, UINT All except S, SA, SB, SC No
IN2
Divisor: the value to divide into IN1; shown
to the right of
MOD
in the equation
IN1 MOD IN2=Q.
INT, DINT, UINT All except S, SA, SB, SC No
Q
The remainder of IN1/IN2.
INT, DINT, UINT
variable
All except S, SA, SB, SC
and constant
No
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...