Download Siemens S7-400 Technical data

Transcript
Integer Math Instructions
7.6
DIV_I Divide Integer
Symbol
DIV_I
EN ENO
IN1
IN2 OUT
Parameter
Data Type
Memory Area
Description
EN
BOOL
I, Q, M, L, D
Enable input
ENO
BOOL
I, Q, M, L, D
Enable output
IN1
INT
I, Q, M, L, D
or constant
Dividend
IN2
INT
I, Q, M, L, D
or constant
Divisor
OUT
INT
I, Q, M, L, D
Result of division
Description
DIV_I (Divide Integer) is activated by a logic "1" at the Enable (EN) Input. IN1 is
divided by IN2 and the result can be scanned at OUT. If the result is outside the
permissible range for an integer (16-bit), the OV bit and OS bit is "1" and ENO is
logic "0", so that other functions after this math box which are connected by ENO
(cascade arrangement) are not executed.
See also Evaluating the Bits of the Status Word with Integer Math Instructions.
Status word
writes:
BR
CC 1
CC 0
OV
OS
OR
STA
RLO
/FC
x
x
x
x
x
0
x
x
1
Example
I 0.0
MW0
MW2
DIV_I
EN
IN1
IN2
ENO
NOT
OUT
MW10
Q 4.0
S
The DIV_I box is activated if I0.0 = "1". The result of the division MW0 by MW2 is
output to MW10. If the result was outside the permissible range for an integer, the
output Q4.0 is set.
7-6
Ladder Logic (LAD) for S7-300 and S7-400 Programming
A5E00706949-01