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
259
8.5.4
NEG (Create twos complement)
Table 8- 50 NEG (create twos complement) instruction
LAD / FBD
SCL
Description
-(in);
The NEG instruction inverts the arithmetic sign of the value at parameter IN and stores
the result in parameter OUT.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 51 Data types for parameters
Parameter
Data type
1
Description
IN
SInt, Int, DInt, Real, LReal, Constant
Math operation input
OUT
SInt, Int, DInt, Real, LReal
Math operation output
1
The IN and OUT parameters must be the same data type.
Table 8- 52 ENO status
ENO
Description
1
No error
0 The resulting value is outside the valid number range of the selected data type.
Example for SInt: NEG (-128) results in +128 which exceeds the data type maximum.
8.5.5
INC (Increment) and DEC (Decrement)
Table 8- 53 INC and DEC instructions
LAD / FBD
SCL
Description
in_out := in_out + 1;
Increments a signed or unsigned integer number value:
IN_OUT value +1 = IN_OUT value
in_out := in_out - 1;
Decrements a signed or unsigned integer number value:
IN_OUT value - 1 = IN_OUT value
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals