
13-5
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
13.3 Compare Floating-Point Numbers
The Compare Floating-Point Numbers instruction triggers a comparison
operation. You can use this instruction like a normal contact. This instruction
compares inputs IN1 and IN2 according to the type of comparison you select
from the browser. Table 13-5 lists the valid comparisons.
If the comparison is true, the result of logic operation (RLO) of the function
is 1. Otherwise it is 0. There is no negation of the compare output, because
this logic can also be handled by the inverse compare function.
Table 13-5 Types of Comparisons for Floating-Point Numbers
Type of Comparison Symbols in Name at Top of Box
IN1 is equal to IN2. ==
IN1 is not equal to IN2. <>
IN1 is greater than IN2. >
IN1 is less than IN2. <
IN1 is greater than or equal to IN2. >=
IN1 is less than or equal to IN2. <=
Table 13-6 Compare Floating-Point Numbers: Box and Parameters (Example: less than)
LAD Box Parameter Data Type Memory Area Description
CMP
IN1 REAL I, Q, M, D, L First value to compare
IN1
IN2
,
,
,
,
econ
va
ue
o compare
Status Word Bits
BR CC 1 CC 0 OV OS OR STA RLO FC
Write – x x x x x 1 x 1
I 0.1
Output Q 4.0 is set if the following
conditions exist:
S There is a signal state of 1 at
inputs I 0.0 and I 0.1
S And MD0 = MD4
S And there is a signal state of 1 at
input I 0.2
Q 4.0
CMP
== R
IN2MD4
IN1MD0
I 0.0 I 0.2
S
Comparison is true:
Figure 13-3 Compare Floating-Point Numbers
Description
Comparison Instructions
Kommentare zu diesen Handbüchern