Specifications
SIMATIC Instructions
9-81
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
9.9 SIMATIC Real Math Instructions
Add Real, Subtract Real
The Add Real and Subtract Real instructions add or
subtract two 32-bit real numbers and produce a 32-bit
real number 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: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
These instructions affect the following Special Memory
bits: SM1.0 (zero); SM1.1 (overflow); SM1.2 (negative)
SM1.1 is used to indicate overflow errors and illegal
values. If SM1.1 is set, then the status of SM1.0 and
SM1.2 is not valid and the original input operands are not
altered. If SM1.1 is not set, then the math operation has
completed with a valid result and SM1.0 and SM1.2
contain valid status.
Inputs/Outputs Operands Data Types
IN1, IN2 VD, ID, QD, MD, SD, SMD, AC, LD, Constant, *VD, *AC, *LD REAL
OUT VD, ID, QD, MD, SD, SMD, AC, LD, *VD, *AC, *LD 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
S
T
L
OUT
ADD_R
EN
IN1
IN2
OUT
OUT
SUB_R
EN
IN1
IN2
OUT
+R IN1, OUT
-R IN1, OUT
F
B
D
ENO
ENO
222 224
333
221