2-205
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
ModReal
ModReal
The ModReal instruction calculates the remainder of real number division.
* If you omit an input parameter, the default value is not applied. A building error will occur.
The ModReal instruction divides dividend In1 by divisor In2 to find the remainder.
The following example is for when In1 is REAL#−9.9 and In2 is REAL#−3.14. The value of variable
abc will be REAL#−0.48.
Instruction Name FB/FUN Graphic expression ST expression
ModReal Real Number
Modulo-division
FUN Out:=ModReal(In1, In2);
Variables
Name Meaning I/O Description Valid range Unit Default
In1 Dividend
Input
Dividend
Depends on data type. --- *
In2 Divisor Divisor
Out Remainder Output Remainder Depends on data type. --- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1 OK OK
In2 OK OK
Out OK OK
Function
(@)ModReal
EN ENO
In1 Out
In2
abc:=ModReal(REAL#-9.9, REAL#-3.14);
LD ST
REAL#-3.14
REAL#-9.9
abc
ModReal
EN ENO
In1
In2