14.5
Remainder
MOD
This function outputs the remainder of input values ((s1)÷(s2)).
Structured text
The function is described as an operator. ( MELSEC iQ-R Programming Manual (Program Design))
Setting data
■Description, type, data type
Argument
Description
s1 (IN1)
Dividend
s2 (IN2)
Divisor
d
Output
Processing details
■Operation processing
• This function performs division between the INT, DINT, WORD, or DWORD data type values input to (s1) and (s2)
((s1)÷(s2)), and output the remainder of the operation result, in the same data type as (s), from (d).
Ex.
Data type: INT
(s1)
÷
5
INT
• Input an INT, DINT, WORD, or DWORD data type value to (s1) and (s2). (Note that the value input to (s2) shall be other
than 0.)
■Operation result
The operation processing is performed. The operation result is output from (d).
Operation error
• When (s1) and (s2) are of INT or WORD data type
Error code
Description
3400H
The value (divisor) input to (s2) is 0.
• When (s1) and (s2) are of DINT or DWORD data type
Error code
Description
3400H
The value (divisor) input to (s2) is 0.
(s2)
2
INT
Type
Input variable
Input variable
Output variable
Quotient
2
The value is not output.
14 ARITHMETIC OPERATION FUNCTIONS
Data type
ANY_INT
ANY_INT
ANY_INT
14
(d)
Remainder
1
INT
185
14.5 Remainder