Description
You can use the "Return remainder of division" instruction to divide the value at input IN1 by the value at input IN2 and query the remainder of division at output OUT.
Parameters
The following table shows the parameters of the "Return remainder of division" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
EN |
Input |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Enable output |
|
IN1 |
Input |
Integers |
I, Q, M, D, L, P or constant |
I, Q, M, D, L, P or constant |
Dividend |
|
IN2 |
Input |
Integers |
I, Q, M, D, L, P or constant |
I, Q, M, D, L, P or constant |
Divisor |
|
OUT |
Output |
Integers |
I, Q, M, D, L, P |
I, Q, M, D, L, P |
Remainder of division |
You can select the data type of the instruction from the "???" drop-down list of the instruction box.
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
If the "TagIn" operand has signal state "1", the instruction is executed. The value of operand "Tag_Value1" is divided by the value of operand "Tag_Value2". The remainder of division is stored in operand "Tag_Result". If the instruction is executed without errors, the enable output ENO has the signal state "1" and the "TagOut" output is set.