
B-13
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
B.5 Integer Math Instructions
The sample program in Figure B-11 shows you how to use three integer math
instructions to produce the same result as the following equation:
MD4 +
(IW0 ) DBW3) 15
MW0
DB1
OPN
Network 1: Open Data Block DB1
Network 2: Input word IW0 is added to shared data word DBW3 (data block must be defined and
opened) and the sum is loaded into memory word MW100. MW100 is then multiplied by 15 and the
answer stored in memory word MW102. MW102 is divided by MW0 with the result stored in MW4. As
long as all results are in the permissible range of each instruction, the ENO passes a signal state of 1
to the next box.
ADD_I
IN1
ENOEN
IN2
OUT
DBW3
IW0
MW100
MUL_I
IN1
ENOEN
IN2 OUT
MW100
15 MW102
DIV_I
IN1
ENOEN
IN2 OUT
MW102
MW0 MD4
Figure B-11 Ladder Logic for Integer Math Instructions
Solving a Math
Problem
Programming Examples
Kommentare zu diesen Handbüchern