ENO status
NEG instruction
Note
The IN and OUT parameters must be the same data type.
Parameter
IN
OUT
ENO status
Increment and Decrement instructions
Parameter
IN/OUT
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
Description
1
No error
0
Value IN2 = 0, OUT is assigned the value zero
You use the NEG (negation) instruction to invert the arithmetic sign of the
value at parameter IN and store the result in parameter OUT.
Click below the box name and select a data type from the drop-down
menu.
Data type
SInt, Int, DInt, Real, LReal, Constant
SInt, Int, DInt, Real, LReal
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.
You use the INC and DEC instructions to:
Increment a signed or unsigned integer number value
INC (increment): Parameter IN/OUT value +1 = parameter IN/OUT
value
Decrement a signed or unsigned integer number value
DEC (decrement): Parameter IN/OUT value - 1 = parameter IN/OUT
value
Click below the box name and select a data type from the drop-down
menu.
Data type
SInt, Int, DInt, USInt, UInt, UDInt
Programming instructions
6.1 Basic instructions
Description
Math operation input
Math operation output
Description
Math operation input and output
115