Integer Addition and Subtraction Integer Math

Inputs/Outputs Operands Data Types
IN1, IN2 VW, IW, QW, MW, SW, SMW, T, C, AC, LW, AIW, Constant, *VD, *AC, *LD INT
OUT VW, IW, QW, MW, SW, SMW, T, C, LW, AC, *VD, *AC, *LD INT

Memory Ranges ENO Errors Instruction Support for S7-200 CPUs SIMATIC/International Mnemonics
The Add Integer and Subtract Integer instructions add or subtract two 16-bit integers and produce a 16-bit result (OUT).

In LAD and FBD: IN1 + IN2 = OUT

IN1 IN2 = OUT

In STL: IN1 + OUT = OUT

OUT IN1 = OUT

Error Conditions that Set ENO = 0:

0006 (indirect address), SM1.1 (overflow), SM4.3 (run-time)

These instructions affect the following Special Memory bits:

SM1.0 (zero); SM1.1 (overflow); SM1.2 (negative)


Example