Chapter 8 Logic Instructions
8.8.6 MODREAL
FC
MODREAL finds the remainder for division of two floating- point variables or
constants.
DVP15MC11T
Parameters
Meaning
Description Valid range
In1 Dividend Input Dividend
Depends on the data type of
the variable that the input
parameter is connected to.
In2 Divisor Input Divisor
Depends on the data type of
the variable that the input
parameter is connected to. 0 is
excluded.
Out Remainder Output
The remainder got by dividing
In1 by In2
Depends on the data type of
the variable that the output
parameter is connected to.
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1
● ●
In2
● ●
Out
● ●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data type.
Function Explanation
The instruction is used to find the remainder of the division of two floating- point variables or
constants and the result is output to Out.
The input variable and input variable or the input variable and output variable are allowed to be of
different data types in this instruction.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if
any input variable is omitted. But the output variable is allowed to omit.
The input value of In2 can not be 0. In other words, the divisor in the division operation can not be 0.
The value of Out will be 0 if the value of In2 is 0.
8-67