Iec Math Instructions; Add, Subtract; Multiply, Divide - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

IEC 1131-3 Instructions
10.5

IEC Math Instructions

Add, Subtract

L
A
EN
D
F
IN1
B
D
IN2
EN
IN1
IN2
221
222 224
Inputs/Outputs
IN1, IN2
VW, IW, QW, MW, SW, SMW, LW, AIW, T, C, VD, ID, QD, MD,
SMD, SD, LD, HC, AC, Constant, *VD, *AC, *LD
OUT
VW, IW, QW, MW, SW, SMW, LW, T, C, VD, ID, QD, MD, SMD,
SD, LD, AC, *VD, *AC, *LD
Note
Real or floating-point numbers are represented in the format described in the
ANSI/IEEE 754-1985 standard (single-precision). Refer to the standard for more
information.

Multiply, Divide

L
A
EN
D
F
IN1
B
D
IN2
EN
IN1
IN2
221
222
10-18
The Add and Subtract functions add or subtract IN1 and
IN2 and place the result in OUT. The input and output
ADD
ENO
data types can vary, but must be of the same type. For
example, two 16-bit variables can be added or
OUT
OUT
subtracted, but the result must be placed in a 16-bit
variable; the result of adding or subtracting two 32-bit
variables must be placed in a 32-bit variable.
SUB
ENO
In LAD:
OUT
OUT
Error conditions that set ENO = 0: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
These functions affect the following Special Memory bits:
SM1.0 (zero); SM1.1 (overflow); SM1.2 (negative
226
Operands
The Multiply function multiplies IN1 and IN2 and places
the result in the variable specified by OUT.
MUL
ENO
The Divide function divides IN1 by IN2 and places the
result in the variable specified by OUT.
OUT
OUT
The input and output data types can vary, but must be of
the same type. For example, the product of multiplying
DIV
two 16-bit variables must be placed in a 16-bit variable,
ENO
the product of multiplying two 32-bit variables must be
placed in a 32-bit variable.
OUT
OUT
In LAD:
Error conditions that set ENO = 0: SM1.1 (overflow),
SM1.3 (divide-by-zero), SM4.3 (run-time), 0006 (indirect
224
226
address)
IN1 + IN2 = OUT
IN1 - IN2 = OUT
INT, DINT, REAL
INT, DINT, REAL
IN1 IN2 = OUT
IN1 / IN2 = OUT
S7-200 Programmable Controller System Manual
)
Data Types
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents