27.5
Remainder
MOD(_E)
RnPCPU
RnCPU RnENCPU
(Process)
These functions output the remainder of input values ((s1)(s2)).
Ladder, FBD/LD
[Without EN/ENO]
s1
d
s2
Setting data
■Description, type, data type
Argument
EN
s1 (IN1)
s2 (IN2)
ENO
d
Processing details
■Operation processing
• These functions perform division between the INT or DINT 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 or DINT data type value to (s1) and (s2), provided that the value input to (s2) shall be other than 0.
■Operation result
1.
Function without EN/ENO
The operation processing is performed. The operation result is output from (d).
2.
Function with EN/ENO
The execution conditions and operation results will be as follows.
Execution condition
EN
TRUE (executed)
FALSE (not executed)
*1 If the value FALSE is output from ENO, the output data from (d) will be undefined. Create a program so that the undefined value will not
be used in operations.
27 ARITHMETIC OPERATION FUNCTIONS
1914
27.5 Remainder
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
[With EN/ENO]
EN
ENO
s1
s2
Description
Execution condition (TRUE: Executed, FALSE: Not executed)
Dividend
Divisor
Output status (TRUE: Normal, FALSE: Abnormal)
Output
(s2)
÷
2
INT
Operation result
ENO
TRUE
FALSE
Structured text
[Without EN/ENO]
The function is described as an operator. ( MELSEC iQ-R Programming
Manual (Program Design))
[With EN/ENO]
d:=MOD_E(EN,ENO,s1,s2);
d
The value is not output.
*1
Type
Data type
Input variable
BOOL
Input variable
ANY_INT
Input variable
ANY_INT
Output variable
BOOL
Output variable
ANY_INT
Quotient
Remainder
2
(d)
Operation result output value
Undefined value
(d)
1
INT