
14-14
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
14.12 Negate Floating-Point Number
The Negate Floating-Point Number instruction reads the contents specified in
the input parameter IN and inverts the sign bit, that is, the instruction
changes the sign of the number (for example from 0 for plus to 1 for minus).
The bits of the exponent and mantissa remain the same. The output
parameter OUT provides the result. ENO and EN always have the same
signal state.
Certain restrictions apply to the placement of the Negate Floating-Point
Number conversion box (see Section 6.1).
Table 14-12 Negate Floating-Point Number Box and Parameters
LAD Box Parameter Data Type Memory Area Description
NEG R
EN BOOL I, Q, M, D, L Enable input
_
EN ENO
ENO BOOL I, Q, M, D, L Enable output
IN OUT
IN REAL I, Q, M, D, L Input value
OUT REAL I, Q, M, D, L The result is the negated form of the
input value.
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
MD12 with the opposite sign, as shown in the
following example:
MD8 = +6.234 x 10
–3
→ MD12 = –6.234 x 10
–3
If the conversion is not executed, the signal state
of output Q 4.0 is 1 (ENO = EN).
Q 4.0
NEG_R
IN
EN ENO
MD8 MD12
BR CC 1 CC 0 OV OS OR STA RLO FC
Write x – – – – 0 x x 1
NOT
OUT
Function is executed (EN = 1):
Figure 14-12 Negate Floating-Point Number
Move and Conversion Instructions
Comentarios a estos manuales