Specifications
IEC 1131-3 Instructions
10-19
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
10.5 IEC Math Instructions
Table 10-6 gives page references for the non-standard IEC Math instructions.
Table 10-6 Non-Standard IEC Math Instructions
Description
Page
PID Instruction 9-84
Add, Subtract
The Add and Subtract functions add or subtract IN1 and
IN2 and place the result in OUT. The input and output
data types can vary, but must be of the same type. For
example, two 16-bit variables can be added or
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.
In LAD: IN1 + IN2 = OUT
IN1 - IN2 = 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)
Inputs/Outputs
Operands Data Types
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
INT, DINT, REAL
OUT VW, IW, QW, MW, SW, SMW, LW, T, C, VD, ID, QD, MD, SMD,
SD, LD, AC, *VD, *AC, *LD
INT, DINT, REAL
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.
L
A
D
F
B
D
OUT
ADD
EN
IN1
IN2
OUT
OUT
SUB
EN
IN1
IN2
OUT
ENO
ENO
222 224
333
221