EasyManuals Logo

Siemens Simatic S7 Series System Manual

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #259 background imageLoading...
Page #259 background image
Program instructions
7.8 Math
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
259
7.8
Math
7.8.1
Add, subtract, multiply, and divide
LAD / FBD
STL
Description
ADD_DI
ADD_R
+I IN1, OUT
+D IN1, OUT
+R IN1, OUT
The Add Integer instruction adds two 16-bit integers to produce a 16-bit
result. The Add Double Integer instruction adds two 32-bit integers to pro-
duce a 32-bit result. The Add Real (+R) instruction adds two 32-bit real
numbers to produce a 32-bit real number result.
LAD and FBD: IN1 + IN2 = OUT
STL:
IN1 + OUT = OUT
SUB_DI
SUB_R
-I IN1, OUT
-D IN1, OUT
-R IN1, OUT
The Subtract Integer instruction subtracts two 16-bit integers to produce a
16-bit result. The Subtract Double Integer (-D) instruction subtracts two 32-
bit integers to produce a 32-bit result. The Subtract Real (-R) instruction
subtracts two 32-bit real numbers to produce a 32-bit real number result.
LAD and FBD: IN1 - IN2 = OUT
STL: OUT - IN1 = OUT
MUL_DI
MUL_R
*I IN1, OUT
*D IN1, OUT
*R IN1, OUT
The Multiply Integer instruction multiplies two 16-bit integers to produce a
16-bit result. The Multiply Double Integer instruction multiplies two 32-bit
integers to produce a 32-bit result. The Multiply Real instruction multiplies
two 32-bit real numbers to produce a 32-bit real number result.
LAD and FBD: IN1 * IN2 = OUT
STL: IN1 * OUT = OUT
DIV_DI
DIV_R
/I IN1, OUT
/D IN1, OUT
/R IN1, OUT
The Divide Integer instruction divides two 16-bit integers to produce a 16-bit
result. (No remainder is kept.) Divide Double Integer instruction divides two
32-bit integers to produce a 32-bit result. (No remainder is kept.) The Divide
Real (/R) instruction divides two 32-bit real numbers to produce a 32-bit real
number result.
LAD and FBD: IN1 / IN2 = OUT
STL: OUT / IN1 = OUT
Non-fatal errors with ENO = 0
SM bits affected
0006H Indirect address
SM1.1 Overflow
SM1.3 Divide by zero
SM1.0 Result of operation = zero
SM1.1 Overflow, illegal value generated during the operation, or illegal
input
SM1.2 Negative result
SM1.3 Divide by zero

Table of Contents

Other manuals for Siemens Simatic S7 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens Simatic S7 Series and is the answer not in the manual?

Siemens Simatic S7 Series Specifications

General IconGeneral
CPUVaries by model (e.g., S7-300, S7-400, S7-1200, S7-1500)
Communication InterfacesPROFIBUS, PROFINET, Ethernet, MPI
ProgrammingTIA Portal, STEP 7
Programming LanguagesLAD, FBD, STL, SCL, GRAPH
I/O ModulesDigital, Analog, Specialty modules available
Operating Temperature0°C to 60°C (standard models)
MountingDIN rail mounting
Operating Voltage24V DC or 120/230V AC (varies by model)
Protection ClassIP20 (standard models)
MemoryVaries depending on the S7 model. Includes work memory (RAM) for program execution, load memory (EEPROM or Flash) for program storage, and system memory for operating system functions. Memory sizes range from kilobytes to megabytes.

Related product manuals