EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 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
Loading...
Basic instructions
8.5 Math functions
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
257
8.5.2
Add, subtract, multiply and divide instructions
Table 8- 44 Add, subtract, multiply and divide instructions
LAD / FBD
SCL
Description
out := in1 + in2;
out := in1 - in2;
out := in1 * in2;
out := in1 / in2;
ADD: Addition (IN1 + IN2 = OUT)
SUB: Subtraction (IN1 - IN2 = OUT)
MUL: Multiplication (IN1 * IN2 = OUT)
DIV: Division (IN1 / IN2 = OUT)
An Integer division operation truncates the fractional part of the quotient
to produce an integer output.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 45 Data types for the parameters (LAD and FBD)
Parameter
Data type
1
Description
IN1, IN2
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Constant
Math operation inputs
OUT SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal Math operation output
1
Parameters IN1, IN2, and OUT must be the same data type.
To add an ADD or MUL input, click the "Create" icon or right
-click on an input
stub for one of the existing IN parameters and select the "Insert input" command.
To remove an input, right-click on an input stub for one of the existing IN parameters (when
there are more than the original two inputs) and select the "Delete" command.
When enabled (EN = 1), the math instruction performs the specified operation on the input
values (IN1 and IN2) and stores the result in the memory address specified by the output
parameter (OUT). After the successful completion of the operation, the instruction sets ENO
= 1.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals