
14-13
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
14.11 Twos Complement Double Integer
The Twos Complement Double Integer instruction reads the contents
specified in the input parameter IN and changes the sign (for example, from a
positive value to a negative value). The output parameter OUT provides the
result. If the signal state of EN is 0, then the signal state of ENO is 0. If the
signal state of EN is 1 and an overflow occurs, the signal state of ENO is 0.
Certain restrictions apply to the placement of the Twos Complement Double
Integer
conversion box (see Section 6.1).
Table 14-11 Twos Complement Double Integer Box and Parameters
LAD Box Parameter Data Type Memory Area Description
NE
DI
EN BOOL I, Q, M, D, L Enable input
_
EN ENO
ENO BOOL I, Q, M, D, L Enable output
IN OUT
IN DINT I, Q, M, D, L Input value
OUT DINT I, Q, M, D, L Twos complement double integer
Status Word Bits
I 0.0
If the signal state of input I 0.0 is 1, the conversion
is executed. The value of memory double word
MD8 is provided at OUT in memory double word
MD10 with the opposite sign, as shown in the
following example:
MD8 = +60.000 → MD10 = – 60.000.
If the signal state of EN is 1 and an overflow
occurs, the signal state of ENO is 0 and the signal
state of output Q 4.0 is 1. If the conversion is not
executed, the signal state of output Q 4.0 is 1
(ENO = EN).
Q 4.0
NEG_DI
EN ENO
MD12INMD8
BR CC 1 CC 0 OV OS OR STA RLO FC
Write x x x x x x 1 x x
Function is executed (EN = 1):
NOT
OUT
Figure 14-11 Twos Complement Double Integer
Description
Move and Conversion Instructions
Comentarios a estos manuales