
Conversion Instructions
Ladder Logic (LAD) for S7-300 and S7-400 Programming
A5E00706949-01
3-11
3.11 NEG_DI Twos Complement Double Integer
Symbol
NEG_DI
ENOEN
IN OUT
Parameter Data Type Memory Area Description
EN BOOL I, Q, M, L, D Enable input
ENO BOOL I, Q, M, L, D Enable output
IN DINT I, Q, M, L, D Double integer input value
OUT DINT I, Q, M, L, D Twos complement of IN value
Description
NEG_DI
(Twos Complement Double Integer) reads the content of the IN parameter
and performs a twos complement instruction. The twos complement instruction is
equivalent to multiplication by (-1) and changes the sign (for example: from a
positive to a negative value). ENO always has the same signal state as EN with the
following exception: if the signal state of EN = 1 and an overflow occurs, the signal
state of ENO = 0.
Status word
BR CC 1 CC 0 OV OS OR STA RLO /FC
writes: x x x x x 0 x x 1
Example
Q 4.0
I 0.0
MD8
NEG_DI
ENOEN
IN OUT
MD12
NOT
If I0.0 is "1", then the value of MD8 with the opposite sign is output by the OUT
parameter to MD12.
MD8 = + 1000 results in MD12 = - 1000.
The output Q4.0 is "1" if the conversion is not executed (ENO = EN = 0).
If the signal state of EN = 1 and an overflow occurs, the signal state of ENO = 0.
Comments to this Manuals