Negation Instruction; Increment And Decrement Instructions - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

7.5.4

Negation instruction

Table 7- 44
NEG instruction
LAD / FBD
SCL
-(in);
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 45
Data types for parameters
Parameter
Data type
IN
SInt, Int, DInt, Real, LReal, Constant
OUT
SInt, Int, DInt, Real, LReal
The IN and OUT parameters must be the same data type.
1
Table 7- 46
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.
7.5.5

Increment and decrement instructions

Table 7- 47
INC and DEC instructions
LAD / FBD
SCL
in_out := in_out + 1;
in_out := in_out - 1;
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
Description
The NEG instruction inverts the arithmetic sign of the value at parameter IN and stores
the result in parameter OUT.
1
Description
Increments a signed or unsigned integer number value:
IN_OUT value +1 = IN_OUT value
Decrements a signed or unsigned integer number value:
IN_OUT value - 1 = IN_OUT value
100BBasic instructions
Description
Math operation input
Math operation output
7.5 Math
189

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents