Mod (Return Remainder Of Division) Instruction - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Table 7- 40
ENO status
ENO
Description
1
No error
0
The Math operation result value would be outside the valid number range of the data type selected. The
least significant part of the result that fits in the destination size is returned.
0
Division by 0 (IN2 = 0): The result is undefined and zero is returned.
0
Real/LReal: If one of the input values is NaN (not a number) then NaN is returned.
0
ADD Real/LReal: If both IN values are INF with different signs, this is an illegal operation and NaN is
returned.
0
SUB Real/LReal: If both IN values are INF with the same sign, this is an illegal operation and NaN is
returned.
0
MUL Real/LReal: If one IN value is zero and the other is INF, this is an illegal operation and NaN is
returned.
0
DIV Real/LReal: If both IN values are zero or INF, this is an illegal operation and NaN is returned.
7.5.3

MOD (return remainder of division) instruction

Table 7- 41
Modulo (return remainder of division) instruction
LAD / FBD
SCL
out := in1 MOD in2;
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 42
Data types for parameters
Parameter
Data type
IN1 and IN2
SInt, Int, DInt, USInt, UInt, UDInt, Constant
OUT
SInt, Int, DInt, USInt, UInt, UDInt
The IN1, IN2, and OUT parameters must be the same data type.
1
Table 7- 43
ENO values
ENO
Description
1
No error
0
Value IN2 = 0, OUT is assigned the value zero
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Description
You can use the MOD instruction to return the remainder of an integer
division operation. The value at the IN1 input is divided by the value at
the IN2 input and the remainder is returned at the OUT output.
1
Basic instructions
7.5 Math functions
Description
Modulo inputs
Modulo output
231

Advertisement

Table of Contents
loading

Table of Contents